View as Markdown

Exchange rates

Exchange rates are the daily rates the platform converts to DKK with. A rate is quoted as the price in DKK of 100 units of the base currency (EUR reads 747.44). A rate belongs to a set: Aleta's shared global set, with the source that delivered it as its provider, Aleta's manual set, or your own external set. 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 set; Aleta's sets are read-only for you. Your own rates are stored and listed; the calculation does not read them.

Data model

idstring

Stable identifier for the rate. A UUID for your own rate; an opaque id for a rate in Aleta's sets.

base_currencystring

ISO 4217 code of the currency being priced.

quote_currencystring

Always DKK.

datestring

ISO date (yyyy-mm-dd) of the observation.

ratedecimal string

DKK per 100 units of the base currency, with every digit kept.

setstring

global, manual or external (your own).

providerstring | null

The source of a global rate: ecb, danmarks_nationalbank, legacy, six, reuters, bloomberg or calculated, one per legacy source. null for the other sets. Danmarks Nationalbank's rates are stored and shown as ecb, and the legacy platform's own as calculated.

ownerstring

aleta for Aleta's sets, tenant for your own.

originstring

legacy when the rate comes from the legacy platform, v1 when it was made here (your own, or by Aleta's own rate feeds). A legacy rate of your own is read-only until your move to v1 is done (409 legacy_managed).


GET/v1/exchange-rates

List exchange rates

Returns the rates observed on one date in the standard v1 list envelope, ordered by base currency, quote currency, set and provider: Aleta's sets and your own. as_of is the date read. Only observations are listed: a weekend or holiday returns an empty page, and no rate is carried forward from an earlier date.

Query parameters

datestring

ISO date (yyyy-mm-dd). Required.

base_currencystring

Only this base currency. Optional; not a three-letter code is a 400 problem.

quote_currencystring

Only this quote currency. Optional; not a three-letter code is a 400 problem.

setstring

Only this set: global, manual or external. Optional; anything else, a provider too, is a 400 problem.

providerstring

Only this provider of the global set. Optional; an unknown provider, or a provider with a set other than global, is a 400 problem, never an empty list. Nationalbanken's rates are listed under ecb and the legacy platform's derived rates under calculated.

limitinteger

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

cursorstring

next_cursor of the previous page for the same date. Optional; any other cursor is a 400 problem.

Errors

400 for a missing or invalid date, an invalid cursor and the filters above, 403 without the scope or the module. Any other query parameter is a 400 problem.

Request
GET/v1/exchange-rates
curl -G https://api.aleta.ai/v1/exchange-rates \
  -H "Authorization: Bearer {access_token}" \
  -d date=2026-06-30 \
  -d base_currency=EUR
Response
{
  "data": [
    {
      "id": "019a1f4e-6c1d-7b42-9d3e-2f6a0c8b1e55",
      "base_currency": "EUR",
      "quote_currency": "DKK",
      "date": "2026-06-30",
      "rate": "747.5",
      "set": "external",
      "provider": null,
      "owner": "tenant",
      "origin": "v1"
    },
    {
      "id": "Znh8RVVSfERLS3xlY2J8MjAyNi0wNi0zMA",
      "base_currency": "EUR",
      "quote_currency": "DKK",
      "date": "2026-06-30",
      "rate": "747.44",
      "set": "global",
      "provider": "ecb",
      "owner": "aleta",
      "origin": "legacy"
    }
  ],
  "next_cursor": null,
  "limit": 100,
  "as_of": "2026-06-30"
}

POST/v1/exchange-rates

Create an exchange rate

Stores your own rate (set external). A rate on the same currencies and date replaces yours. Returns 201 for a new rate and 200 when it replaced one. Supports ?dry_run=true and an Idempotency-Key header, and every write is kept in the change log.

Body parameters

base_currencystring

ISO 4217 code. Required.

quote_currencystring

Must be DKK. Required.

datestring

ISO date (yyyy-mm-dd). Required.

ratedecimal string

DKK per 100 units, greater than 0. Required.

setstring

external, or left out. Naming another set or a provider is a 403 aleta_owned problem: Aleta's sets are shared and read-only for you.

Errors

  • 400: a missing field, a currency that is not a three-letter code or no known currency, an invalid date, quote_currency other than DKK, the same base and quote currency, a rate of 0 or less, or a field the body does not take.
  • 403 aleta_owned: another set or a provider; next_action names POST /v1/exchange-rates for your own rate.
  • 409 legacy_managed: your rate on the same currencies and date came from the legacy platform, which is still master for you.
Request
POST/v1/exchange-rates
curl -X POST https://api.aleta.ai/v1/exchange-rates \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "base_currency": "EUR",
    "quote_currency": "DKK",
    "date": "2026-06-30",
    "rate": "747.5"
  }'
Response
{
  "id": "019a1f4e-6c1d-7b42-9d3e-2f6a0c8b1e55",
  "base_currency": "EUR",
  "quote_currency": "DKK",
  "date": "2026-06-30",
  "rate": "747.5",
  "set": "external",
  "provider": null,
  "owner": "tenant",
  "origin": "v1"
}

PATCH/v1/exchange-rates/{id}

Update an exchange rate

Changes the rate of one of your own rates; every other field is part of the rate, so change one with a DELETE and a POST. Body: rate (DKK per 100 units) and an optional reason, kept in the change log; any other field is a 400 problem. Returns 200 with the rate. Supports ?dry_run=true and Idempotency-Key. An unknown id is a 404, the id of a rate in Aleta's sets a 403 aleta_owned whose next_action names POST /v1/exchange-rates, and a rate of yours from the legacy platform a 409 legacy_managed while legacy is master for you, in that order.


DELETE/v1/exchange-rates/{id}

Delete an exchange rate

Retracts one of your own rates: it leaves every list, and the record stays. Optional query parameter reason, kept in the change log. Any query parameter other than reason and dry_run is a 400 problem. Returns 204; a repeat with the same Idempotency-Key answers the same, without one it is a 404. Supports ?dry_run=true. An unknown or retracted id is a 404, the id of a rate in Aleta's sets a 403 aleta_owned whose next_action names POST /v1/exchange-rates, and a rate of yours from the legacy platform a 409 legacy_managed while legacy is master for you.