Ledger
Cost Categories
Cost categories and cost reports
Authentication
Authenticate with Authorization: Bearer ak_... — see API keys. Requests are scoped to one entity. Pass entityId as a query parameter, JSON field, or x-entity-id header. API keys are already pinned to an entity. A mismatched entityId returns 403.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/ledger/cost-categories?entityId= | List cost categories |
| POST | /api/ledger/cost-categories | Create category |
| GET | /api/ledger/cost-reports?entityId= | Cost reports |
List cost categories
GET /api/ledger/cost-categories?entityId={entityId}
Returns cost categories for the entity.
Create category
POST /api/ledger/cost-categories
Body: { "entityId", "name", "code?", "parentId?", ... }
Cost reports
GET /api/ledger/cost-reports?entityId={entityId}
Returns cost reports. Supports period, categoryId, and other filters.