View as Markdown

Market indices

Market indices are what benchmarks are measured against. Aleta keeps a shared list and turns indices on for you; you can add your own. An index may follow an asset, such as an ETF, and a benchmark leg on it is computed on that asset. Reading requires the market_data:read scope and the market data module at read level, writing market_data:write and the module at read-write level. You write only your own indices.

Data model

idstring

A UUID.

legacy_idstring | null

The id the legacy platform knows the index by, for an index it loaded; null for one made here. Filter on it with ?legacy_id=; it is never an id in the path.

codestring | null

The ISIN of a shared index, null when it has none; your own index's code.

namestring

The index name.

currency_codestring

ISO 4217 code.

country_codestring | null

ISO 3166 alpha-2 code.

index_kindstring

price, total_return, net_return or excess_return.

methodology_providerstring

sp, msci, ftse, stoxx, nasdaq, dj or custom.

asset_idstring | null

Your asset the index follows, as GET /v1/assets/{id} takes it; null when the index has its own series, or when you hold no asset for the instrument a shared index follows.

ownerstring

aleta for Aleta's shared list, tenant for your own.

originstring

legacy when the legacy platform loaded it, v1 when it was made here.

created_atstring

RFC 3339 timestamp.

updated_atstring

RFC 3339 timestamp.


GET/v1/market-indices

List market indices

Returns the shared indices Aleta turned on for you and your own, in the standard v1 list envelope, ordered by created_at and id. Until Aleta has turned indices on for you, you see the whole shared list, as on the legacy platform. The list is not dated, so the page has no as_of.

Query parameters

legacy_idstring

Only the index the legacy platform loaded under this id. Optional; empty is a 400 problem.

limitinteger

Page size, default 100, at most 1000. Optional.

cursorstring

next_cursor of the previous page. Optional.

Errors

400 for an empty legacy_id, an invalid cursor or a parameter the list does not take; 403 without the scope or the module.

Response
{
  "data": [
    {
      "id": "019a1f4e-6c1d-7b42-9d3e-2f6a0c8b1e55",
      "legacy_id": null,
      "code": "SE0000000001",
      "name": "OMXS30",
      "currency_code": "SEK",
      "country_code": "SE",
      "index_kind": "price",
      "methodology_provider": "custom",
      "asset_id": null,
      "owner": "tenant",
      "origin": "v1",
      "created_at": "2026-10-16T09:00:00.000000Z",
      "updated_at": "2026-10-16T09:00:00.000000Z"
    }
  ],
  "next_cursor": null,
  "limit": 100
}

GET/v1/market-indices/{id}

Get a market index

Returns one index you see: a shared one turned on for you, or your own. Any other id is a 404 problem.


POST/v1/market-indices

Create a market index

Adds your own index. code and index_kind are unique among your own (409 conflict otherwise); your index may share a code with a shared one. Body: code, name, currency_code (required), country_code, index_kind (default price), methodology_provider (default custom) and asset_id (one of your assets). Supports ?dry_run=true and an Idempotency-Key header, and the write is kept in the change log. Returns 201.

400 for a missing or empty field, a currency_code that is not three letters or a country_code that is not two, a currency or country Aleta does not know, an asset_id that is not a UUID, an unknown index_kind or methodology_provider, an asset_id that is not one of your assets, or a field the body does not take.


PATCH/v1/market-indices/{id}

Update a market index

Changes your own index: any create field, null clears country_code or asset_id, and an optional reason is kept in the change log. Supports ?dry_run=true and Idempotency-Key. Returns 200. An id you do not see is a 404, a shared index a 403 aleta_owned (one the legacy platform loaded too), a body that fails the create checks a 400, and your own index from the legacy platform a 409 legacy_managed while legacy is master for you, in that order; a code and index_kind another of your indices has is a 409 conflict. A body that names no field to change (only reason, or nothing) answers the index as it is, without a write or a change log entry.


DELETE/v1/market-indices/{id}

Delete a market index

Deletes your own index when nothing uses it. Supports ?dry_run=true and Idempotency-Key; a repeat with the same key answers 204 again, without one it is a 404. Returns 204. An id you do not see is a 404, a shared index a 403 aleta_owned, your own index from the legacy platform a 409 legacy_managed while legacy is master for you, and an index with values or a benchmark leg a 409 in_use that says which. A leg in a benchmark names it, and next_action points to PATCH /v1/benchmarks/{id} to take the leg out; a leg counts whether it names the index by its id or, for an index from the legacy platform, by its legacy id.