Acreum Docs
Reporting

KPIs

List KPIs

GET
/v1/kpis

Required scope: reports:read

Pagination: cursor

Error codes: INVALID_CURSOR, VALIDATION_FAILED

Authorization

access-token
headerAuthorizationBearer <token>

Query Parameters

include_inactive?boolean

Include deactivated KPIs in the list.

Defaultfalse
cursor?string
limit?number

1..100, default 50

sort?string

Default: name

Value in"name""-name"

Response Body

application/json
  1. response
data*array<>
meta*
curl -X GET 'https://api.acreum.io/v1/kpis'
{  "data": [    {      "account_refs": [        {          "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",          "code": "4001",          "name": "Rent Income"        }      ],      "basis": "flow",      "created_at": "2019-08-24T14:15:22Z",      "description": "string",      "format": "money",      "formula": {},      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "is_active": true,      "name": "string",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "meta": {    "api_version": "2026-04-23",    "limit": 50,    "next_cursor": "eyJpZCI6ICJhYmMifQ==",    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f"  }}

Create a KPI

POST
/v1/kpis

Required scope: accounting:write

Error codes: VALIDATION_FAILED, CONFLICT, IDEMPOTENCY_KEY_REQUIRED, INVALID_IDEMPOTENCY_KEY, IDEMPOTENCY_CONFLICT

Authorization

access-token
headerAuthorizationBearer <token>

Header Parameters

Idempotency-Key*string

Client-chosen key that makes this mutation safe to retry. Required — a request without one is rejected with IDEMPOTENCY_KEY_REQUIRED. Reusing a key with the same body replays the original response for ~24 hours; reusing it with a different body returns IDEMPOTENCY_CONFLICT.

Match^[A-Za-z0-9_-]{1,255}$
Lengthlength <= 255

Request Body

application/json
  1. body
basis*string
Value in"flow""balance"
description?string|null
format*string
Value in"money""percent""number"
formula*

Recursive KPI formula AST. Node shapes: { type: "op", op: "+"|"-"|""|"/", operands: KpiNode[], label?: string } ("+" n-ary >=1; "-" n-ary >=2 (a-b-c...); "" and "/" binary (exactly 2); the optional label names the operand as a segment for display, purely cosmetic), { type: "account", accountId: uuid, includeSubtree: boolean }, { type: "kpi", kpiId: uuid } (reference to another KPI), { type: "stat_measure", measureKey: string } (a statistical measure), { type: "const", value: string } (decimal string literal). Operators are gated by the dimensional UNIT of their operands, not by the KPI format: money and quantities (stat measures) combine with "+"/"-" only within the same unit, "/" divides money or a quantity by a like quantity into a ratio, and "*" scales by a constant. format is presentation-only — it must agree with the formula's inferred unit (percent requires a ratio result; money/number accept any unit). Validated deeply server-side (shape, unit coherence, referenced accounts/KPIs/stat measures exist and are active, and no cycles).

name*string
Lengthlength <= 120

Response Body

application/json
  1. response
data*
meta*
curl -X POST 'https://api.acreum.io/v1/kpis' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "basis": "flow",  "format": "money",  "formula": {},  "name": "Rent Revenue"}'
{  "data": {    "account_refs": [      {        "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",        "code": "4001",        "name": "Rent Income"      }    ],    "basis": "flow",    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "format": "money",    "formula": {},    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "is_active": true,    "name": "string",    "updated_at": "2019-08-24T14:15:22Z"  },  "meta": {    "api_version": "2026-04-23",    "cursor": {      "has_more": true,      "next": "eyJpZCI6ICJhYmMifQ=="    },    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",    "total_count": 1234  }}
POST
/v1/kpis/preview

Required scope: reports:read

Error codes: VALIDATION_FAILED, LEGAL_ENTITY_NOT_IN_SCOPE

Authorization

access-token
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
basis*string
Value in"flow""balance"
entity_ids?array<string>
format*string
Value in"money""percent""number"
formula*

Recursive KPI formula AST — same shape as on create, including the { type: "stat_measure", measureKey: string } leaf and the optional label on an "op" node (a segment name). Operators are gated by unit, not by format.

group_by?string

none = a single point for period (flow) or as-of (balance); month = a trailing-12-month series (flow only). Default: none.

Value in"none""month"
period?string

Reporting period. Default: this_month.

Value in"this_month""last_month""qtd""ytd""ttm"

Response Body

application/json
  1. response
data*
meta*
curl -X POST 'https://api.acreum.io/v1/kpis/preview' \  -H 'Content-Type: application/json' \  -d '{  "basis": "flow",  "format": "money",  "formula": {}}'
{  "data": {    "delta_pct": 0,    "format": "money",    "points": [      {        "label": "string",        "value": 0      }    ]  },  "meta": {    "api_version": "2026-04-23",    "cursor": {      "has_more": true,      "next": "eyJpZCI6ICJhYmMifQ=="    },    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",    "total_count": 1234  }}

Get a KPI

GET
/v1/kpis/{id}

Required scope: reports:read

Error codes: NOT_FOUND

Authorization

access-token
headerAuthorizationBearer <token>

Path Parameters

id*string

Response Body

application/json
  1. response
data*
meta*
curl -X GET 'https://api.acreum.io/v1/kpis/string'
{  "data": {    "account_refs": [      {        "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",        "code": "4001",        "name": "Rent Income"      }    ],    "basis": "flow",    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "format": "money",    "formula": {},    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "is_active": true,    "name": "string",    "updated_at": "2019-08-24T14:15:22Z"  },  "meta": {    "api_version": "2026-04-23",    "cursor": {      "has_more": true,      "next": "eyJpZCI6ICJhYmMifQ=="    },    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",    "total_count": 1234  }}

Update a KPI

PATCH
/v1/kpis/{id}

Required scope: accounting:write

Error codes: VALIDATION_FAILED, NOT_FOUND, CONFLICT, INVALID_IDEMPOTENCY_KEY, IDEMPOTENCY_CONFLICT

Authorization

access-token
headerAuthorizationBearer <token>

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

Client-chosen key that makes this mutation safe to retry. Optional — a request without one is processed normally, with no replay protection. Reusing a key with the same body replays the original response for ~24 hours; reusing it with a different body returns IDEMPOTENCY_CONFLICT.

Match^[A-Za-z0-9_-]{1,255}$
Lengthlength <= 255

Request Body

application/json
  1. body
basis?string
Value in"flow""balance"
description?string|null
format?string
Value in"money""percent""number"
formula?

Recursive KPI formula AST — same shape as on create, including the { type: "stat_measure", measureKey: string } leaf and the optional label on an "op" node (a segment name). Operators are gated by unit, not by format. Re-validated (shape, unit coherence, refs, cycles) whenever supplied.

is_active?boolean
name?string
Lengthlength <= 120

Response Body

application/json
  1. response
data*
meta*
curl -X PATCH 'https://api.acreum.io/v1/kpis/string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "data": {    "account_refs": [      {        "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",        "code": "4001",        "name": "Rent Income"      }    ],    "basis": "flow",    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "format": "money",    "formula": {},    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "is_active": true,    "name": "string",    "updated_at": "2019-08-24T14:15:22Z"  },  "meta": {    "api_version": "2026-04-23",    "cursor": {      "has_more": true,      "next": "eyJpZCI6ICJhYmMifQ=="    },    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",    "total_count": 1234  }}

Delete a KPI

DELETE
/v1/kpis/{id}

Required scope: accounting:write

Error codes: NOT_FOUND, CONFLICT, INVALID_IDEMPOTENCY_KEY, IDEMPOTENCY_CONFLICT

Authorization

access-token
headerAuthorizationBearer <token>

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

Client-chosen key that makes this mutation safe to retry. Optional — a request without one is processed normally, with no replay protection. Reusing a key with the same body replays the original response for ~24 hours; reusing it with a different body returns IDEMPOTENCY_CONFLICT.

Match^[A-Za-z0-9_-]{1,255}$
Lengthlength <= 255

Response Body

Possible error codes: INVALID_IDEMPOTENCY_KEY

application/json
  1. response
code*string
detail*string
errors?array<>
instance*string
next_action?string

What the caller does next. Sent only by codes that declare it (the PLAN_* codes).

Value in"fix_step""re_preview""retry_later""split_plan""use_plan_mode""release_first""contact_operator"
request_id*string
retryable?boolean

Whether the same request can succeed unchanged later. Sent only by codes that declare it (the PLAN_* codes).

status*number
title*string
type*string
curl -X DELETE 'https://api.acreum.io/v1/kpis/string'
{  "code": "DOCUMENT_ALREADY_POSTED",  "detail": "Document doc_01 is already posted.",  "errors": [    {      "code": "INVALID_VALUE",      "field": "amount",      "message": "must be > 0"    }  ],  "instance": "/v1/documents/doc_01/post",  "next_action": "fix_step",  "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",  "retryable": true,  "status": 409,  "title": "Document already posted",  "type": "https://docs.acreum.io/errors/DOCUMENT_ALREADY_POSTED"}