/holdings/segments

Base URL https://api.babylon.app/v1

GET /holdings/segments

List all segment identifiers, or read one segment ledger by supplying segmentLedger.

Query parameters

  • segmentLedger (optional) — segment identifier to read. Omit it to list the available segment identifiers.

Example request — list segments

GET /holdings/segments

Example response — 200

{
  "name": "SegmentLedger",
  "description": "",
  "columns": ["segmentLedger"],
  "columnTypes": {},
  "rows": [
    {"segmentLedger": "MyGBSegment"},
    {"segmentLedger": "MySASegment"}
  ]
}

Example request — read a segment

GET /holdings/segments?segmentLedger=MyGBSegment

Example response — 200

Stored ledgers can contain additional source and fee columns. The response uses the stored table’s columns in the standard row-oriented envelope.

{
  "name": "MyGBSegment",
  "description": "",
  "columns": [
    "segmentLedger",
    "accountAlias",
    "tradeDate",
    "settleDate",
    "type",
    "quantity",
    "price",
    "netAmount",
    "currency",
    "commission",
    "bourseSymbol"
  ],
  "columnTypes": {
    "quantity": "Decimal",
    "price": "Decimal",
    "netAmount": "Decimal",
    "commission": "Decimal"
  },
  "rows": [
    {
      "segmentLedger": "MyGBSegment",
      "accountAlias": "AJBell-ISA",
      "tradeDate": "2025-10-08",
      "settleDate": "2025-10-10",
      "type": "Buy",
      "quantity": "100",
      "price": "5.318",
      "netAmount": "-531.80",
      "currency": "GBP",
      "commission": "1.50",
      "bourseSymbol": "LSE:PNL"
    }
  ]
}

To receive either response as CSV, send Accept: text/csv.

POST /holdings/segments

POST performs the same read operation with parameters in a JSON request body. It does not append or replace a ledger.

POST /holdings/segments
Content-Type: application/json
{
  "segmentLedger": "MyGBSegment"
}

The response has the same shape as the corresponding GET response. This endpoint supports segment listing and reading; it does not expose append, replace or delete operations.

Further reading

← Back to API