Ledga

Attributes

Searchable business dimensions on transactions, such as customer_id, with an optional strict catalog.

Endpoints

MethodPathDescription
GET /attribute-definitions List the tenant's searchable attribute definitions (catalog)
POST /attribute-definitions Declare a searchable attribute key
PATCH /attribute-definitions/{key} Update an attribute definition's label / indexed flag
GET /attribute-settings Read the tenant's attribute settings (strict mode)
PUT /attribute-settings Toggle the tenant's attribute strict mode

Post with attributes

attributes is a flat map of string keys to string values on POST /transactions (not on batch). Keys are lowercase snake_case, max 64 chars; values max 128 chars; up to 20 per transaction. They are written with the transaction and immutable.

curl -X POST https://ledga.io/api/v1/transactions \
  -H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "effective_date": "2026-01-15",
    "description": "Loan drawdown",
    "idempotency_key": "loan-42-drawdown",
    "attributes": { "customer_id": "C-123", "loan_id": "L-42" },
    "entries": [
      { "account_code": "1200", "type": "debit",  "amount": "1000.00" },
      { "account_code": "2100", "type": "credit", "amount": "1000.00" }
    ]
  }'
curl "https://ledga.io/api/v1/transactions/by-attribute?key=customer_id&value=C-123" \
  -H "Authorization: Bearer sk_xxxxxxxx_your_secret"

Tenant-scoped and cross-ledger by default; add ledger_id to narrow, from / to to bound by creation time.

Strict mode

PUT /attribute-settings with { "strict_mode": true } rejects any key not declared via POST /attribute-definitions. Both need the attributes:admin capability on the key. Declared keys can be relabelled or un-indexed with PATCH /attribute-definitions/{key}.