Skip to content

API Reference

The full set of OneBusiness API endpoints, generated from the route handlers in apps/app/src/app/api/v1/. Use the operation pages in the sidebar for try-it forms and per-operation code samples.

Public REST API for OneBusiness. All routes are scoped to the authenticated party's organisation. Bearer token auth via API keys minted at /settings/api-keys.

Servers

https://app.okavango.io/apiProduction
http://localhost:3000/apiLocal development

List customers

GET
/v1/customers

Lists the active org's customer profiles. Each row includes the system fields plus a custom_fields map reflecting the per-tenant custom-field values. Returns up to 500 rows (no pagination in v1).

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Parameters

Query Parameters

status

Filter by status. all returns every status; default is active.

Type
string
Valid values
"active""inactive""archived""all"
fields

Comma-separated sparse fieldset. Supports id,name,custom_fields or custom_fields.<key>. Unknown keys are dropped silently.

Type
string

Responses

Array of customer-profile envelopes with total count.

application/json
JSON
{
  
"meta": {
  
  
"version": 0,
  
  
"total": 0
  
},
  
"data": [
  
  
{
  
  
  
"id": "string",
  
  
  
"party_id": "string",
  
  
  
"name": "string",
  
  
  
"status": "string",
  
  
  
"account_number": "string",
  
  
  
"payment_terms": "string",
  
  
  
"default_currency": "string",
  
  
  
"credit_limit": "string",
  
  
  
"billing_email": "string",
  
  
  
"contact_first_name": "string",
  
  
  
"contact_last_name": "string",
  
  
  
"contact_email": "string",
  
  
  
"contact_phone": "string",
  
  
  
"notes": "string",
  
  
  
"custom_fields": {
  
  
  
  
"additionalProperties": null
  
  
  
},
  
  
  
"created_at": "string",
  
  
  
"updated_at": "string"
  
  
}
  
]
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Get a customer

GET
/v1/customers/{id}

Returns a single customer profile, honouring ?fields= selection.

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Parameters

Path Parameters

id*

The customer-profile id (uuid).

Type
string
Required
Example"123"

Query Parameters

fields

Comma-separated sparse fieldset. See list endpoint.

Type
string

Responses

Successful response

application/json
JSON
{
  
"meta": {
  
  
"version": 0
  
},
  
"data": {
  
  
"id": "string",
  
  
"party_id": "string",
  
  
"name": "string",
  
  
"status": "string",
  
  
"account_number": "string",
  
  
"payment_terms": "string",
  
  
"default_currency": "string",
  
  
"credit_limit": "string",
  
  
"billing_email": "string",
  
  
"contact_first_name": "string",
  
  
"contact_last_name": "string",
  
  
"contact_email": "string",
  
  
"contact_phone": "string",
  
  
"notes": "string",
  
  
"custom_fields": {
  
  
  
"additionalProperties": null
  
  
},
  
  
"created_at": "string",
  
  
"updated_at": "string"
  
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Update a customer

PATCH
/v1/customers/{id}

Patches top-level fields and/or the custom_fields map. Custom-field values are validated against the active CustomFieldDefinition set — failed keys come back in rejected while siblings still apply.

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Parameters

Path Parameters

id*

The customer-profile id (uuid).

Type
string
Required
Example"123"

Request Body

application/json
JSON
{
  
"status": "string",
  
"account_number": "string",
  
"payment_terms": "string",
  
"default_currency": "string",
  
"credit_limit": null,
  
"billing_email": "string",
  
"contact_first_name": "string",
  
"contact_last_name": "string",
  
"contact_email": "string",
  
"contact_phone": "string",
  
"notes": "string",
  
"custom_fields": {
  
  
"additionalProperties": null
  
}
}

Responses

Successful response

application/json
JSON
{
  
"meta": {
  
  
"version": 0
  
},
  
"data": {
  
  
"id": "string",
  
  
"party_id": "string",
  
  
"name": "string",
  
  
"status": "string",
  
  
"account_number": "string",
  
  
"payment_terms": "string",
  
  
"default_currency": "string",
  
  
"credit_limit": "string",
  
  
"billing_email": "string",
  
  
"contact_first_name": "string",
  
  
"contact_last_name": "string",
  
  
"contact_email": "string",
  
  
"contact_phone": "string",
  
  
"notes": "string",
  
  
"custom_fields": {
  
  
  
"additionalProperties": null
  
  
},
  
  
"created_at": "string",
  
  
"updated_at": "string"
  
},
  
"changed": [
  
  
"string"
  
],
  
"rejected": {
  
  
"additionalProperties": "string"
  
}
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


List metrics

GET
/v1/metrics

Returns the catalog of metrics visible to the caller. Capability filtering happens automatically — metrics requiring scopes the caller doesn't have are omitted.

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Parameters

Query Parameters

category

Filter metrics by category. Omit to list all visible metrics.

Type
string
Valid values
"revenue""profitability""expenses""cash""ar""ap""tax""balance_sheet""people""growth""diversity""pay_equity""quality""vendor""customer""operations"

Responses

List of metric metadata with total count and computedAt timestamp.

application/json
JSON
{
  
"data": [
  
  
{
  
  
  
"id": "string",
  
  
  
"label": "string",
  
  
  
"description": "string",
  
  
  
"category": "string",
  
  
  
"unit": "string",
  
  
  
"shape": "string",
  
  
  
"periodKind": "string",
  
  
  
"requiresCapability": "string",
  
  
  
"related": [
  
  
  
  
"string"
  
  
  
],
  
  
  
"tags": [
  
  
  
  
"string"
  
  
  
]
  
  
}
  
],
  
"meta": {
  
  
"total": 0,
  
  
"version": 0,
  
  
"computedAt": "string"
  
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Describe a metric

GET
/v1/metrics/{id}

Returns metadata for a single metric (label, description, category, unit, shape, accepted periods, required capability) without resolving a value. Useful for catalog browsing and form-building without paying resolver cost.

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Parameters

Path Parameters

id*

The metric id, e.g. revenue.total or cash.balance. See the metric reference for the full list.

Type
string
Required
Example"123"

Responses

The metric's metadata wrapped in the standard envelope.

application/json
JSON
{
  
"data": {
  
  
"id": "string",
  
  
"label": "string",
  
  
"description": "string",
  
  
"category": "string",
  
  
"unit": "string",
  
  
"shape": "string",
  
  
"periodKind": "string",
  
  
"requiresCapability": "string",
  
  
"related": [
  
  
  
"string"
  
  
],
  
  
"tags": [
  
  
  
"string"
  
  
]
  
},
  
"meta": {
  
  
"version": 0,
  
  
"computedAt": "string"
  
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Resolve many metrics in one request

POST
/v1/metrics/batch

Resolves up to 50 metrics in a single request. The batch never short-circuits — each query gets its own ok/error result keyed by the caller-supplied key. Useful for dashboards that need many metrics at once.

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Request Body

application/json
JSON
{
  
"queries": [
  
  
{
  
  
  
"key": "string",
  
  
  
"id": "string",
  
  
  
"period": "string"
  
  
}
  
],
  
"asOf": "string"
}

Responses

Per-key results map and shared meta envelope.

application/json
JSON
{
  
"results": {
  
  
"additionalProperties": null
  
},
  
"meta": {
  
  
"asOf": "string",
  
  
"baseCurrency": "string",
  
  
"computedAt": "string",
  
  
"version": 0
  
}
}

Playground

Server
Authorization
Body

Samples


Resolve a metric value

GET
/v1/metrics/{id}/value

Returns the computed value for a single metric, scoped to the period and as-of date. Capability scopes on the API key gate which metrics resolve.

Authorizations

BearerAuth

API key in the form one_pk_<random>. Mint at /settings/api-keys.

Type
HTTP (bearer)

Parameters

Path Parameters

id*

The metric id, e.g. revenue.total or cash.balance.

Type
string
Required
Example"123"

Query Parameters

period

Period to resolve. Keywords (today, mtd, ytd, last_fy, last_12_months, …) or an absolute range YYYY-MM-DD:YYYY-MM-DD. See the period syntax guide.

Type
string
asOf

Pin all relative periods to this historical date (YYYY-MM-DD or today). Defaults to today.

Type
string

Responses

The resolved metric value wrapped in the standard envelope. data.kind discriminates the shape (scalar, timeseries, etc.).

application/json
JSON
{
  
"data": {
  
  
"kind": "string",
  
  
"value": 0,
  
  
"currency": "string",
  
  
"periodLabel": "string"
  
},
  
"meta": {
  
  
"metric": "string",
  
  
"period": {
  
  
  
"requested": {
  
  
  
  
"type": "string",
  
  
  
  
"startDate": "string",
  
  
  
  
"endDate": "string"
  
  
  
},
  
  
  
"resolved": {
  
  
  
  
"startDate": "string",
  
  
  
  
"endDate": "string",
  
  
  
  
"asOfDate": "string",
  
  
  
  
"kind": "string",
  
  
  
  
"label": "string"
  
  
  
}
  
  
},
  
  
"asOf": "string",
  
  
"baseCurrency": "string",
  
  
"computedAt": "string",
  
  
"version": 0
  
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Powered by VitePress OpenAPI

OneBusiness · Built for businesses that work.