View as Markdown

Historical instrument holdings

Historical-instrument-holdings exists for periods where a live custodian feed can't supply instrument-level positions — onboarding pre-platform history, replacing a damaged feed window, accounting for off-platform vehicles. It writes the same per-instrument shape Aleta normally derives from the ledger, scoped to a depository. v2 has matching account-holding and fee-holding upload endpoints; instrument-level uploads landed on v3 alongside the rest of the instrument family.

Data model

JSON:API resource type: historical-instrument-holding. The body matches the per-instrument holding shape — units, marketValue, accruedInterest, currencyExchangeRate, reportingCurrencyCode — plus date and the depository and instrument relationships.


POST/api/v3/historical-instrument-holdings

Upload an instrument holding

Books a historical instrument holding on a depository. Re-posting the same (depository, instrument, date) triple overwrites the prior record.

Request

POST/api/v3/historical-instrument-holdings
curl -X POST https://platform.aleta.io/api/v3/historical-instrument-holdings \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "historical-instrument-holding",
      "attributes": {
        "date": "2024-12-31",
        "units": 100,
        "marketValue": 85050.00,
        "accruedInterest": 0,
        "currencyExchangeRate": 1.0,
        "reportingCurrencyCode": "DKK"
      },
      "relationships": {
        "depository": { "data": { "type": "depository", "id": "{depository_id}" } },
        "instrument": { "data": { "type": "stock-instrument", "id": "{instrument_id}" } }
      }
    }
  }'

DELETE/api/v3/historical-instrument-holdings

Delete instrument holdings

Deletes instrument-holding rows for a depository over a date range. Body-less — pass the targeting via query parameters.

Query parameters

  • Name
    depositoryId
    Type
    string
    Description

    Depository whose instrument holdings to delete. Required.

  • Name
    fromDate
    Type
    ISO 8601 date
    Description

    Inclusive lower bound. Required.

  • Name
    toDate
    Type
    ISO 8601 date
    Description

    Inclusive upper bound. Required.

Request

DELETE/api/v3/historical-instrument-holdings
curl -X DELETE -G https://platform.aleta.io/api/v3/historical-instrument-holdings \
  -H "Authorization: Bearer {access_token}" \
  -d depositoryId={depository_id} \
  -d fromDate=2024-01-01 \
  -d toDate=2024-12-31
  • Holdings — the live shape these uploads feed.
  • Historical uploads (v2) — the matching account-holding and fee-holding upload endpoints on the v2 prefix.
  • Instruments — the catalog the uploaded holdings reference.