View as Markdown

Legal entities

Legal entities owned by a client, and the accounts and depositories owned by a legal entity.

Data model

Legal entity

JSON:API resource type: legal-entity.

namestring

Display name of the legal entity. Required; must not be empty.

Relationships

accountsarray of account

Accounts owned by the legal entity.

clientclient

Client that owns the legal entity.

depositoriesarray of depository

Depositories owned by the legal entity.

Account

JSON:API resource type: account.

namestring

Optional naming of the account.

externalIdentifierstring

Identifier given to the account by the bank or custodian. Required.

ccyCodestring

ISO 4217 representation of the account's currency. Required.

excludeFromReportingboolean

Flag to exclude the account from reporting. Optional. Default is false, meaning the account is included in reporting.

Relationships

depositorydepository

The depository associated with the account.

depositoriesarray of depository

Depositories linked to the account.

legalEntitylegal-entity

The legal entity that owns the account.

Depository

JSON:API resource type: depository.

namestring

Optional naming of the depository.

externalIdentifierstring

Identifier given to the depository by the bank or custodian. Required.

Relationships

legalEntitylegal-entity

The legal entity that owns the depository.

accountsarray of account

Accounts linked to the depository.


GET/api/v2/clients/{id}/legal-entities

Find all legal entities owned by the client given by id. Returns 200.

Path parameters

idstring

Client identifier, see GET /clients. Required.

Request
GET/api/v2/clients/{id}/legal-entities
curl https://api.aleta.ai/api/v2/clients/6698d912deb64c8b2fec2c08/legal-entities \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": [
    {
      "id": "3c9a3ffa9448a84c1aadc225",
      "type": "legal-entity",
      "attributes": {
        "name": "Company 1"
      },
      "relationships": {
        "client": {
          "data": { "type": "client", "id": "6698d912deb64c8b2fec2c08" }
        },
        "accounts": {
          "data": [{ "type": "account", "id": "6698de390fb223343ef3b648" }]
        },
        "depositories": {
          "data": [{ "type": "depository", "id": "6698debff36caf2dcef8d217" }]
        }
      }
    },
    {
      "id": "67ebe5e3f9302d07aafbbed5",
      "type": "legal-entity",
      "attributes": {
        "name": "Company 2"
      },
      "relationships": {
        "client": {
          "data": { "type": "client", "id": "6698d912deb64c8b2fec2c08" }
        },
        "accounts": {
          "data": []
        },
        "depositories": {
          "data": []
        }
      }
    }
  ]
}

GET/api/v2/legal-entities/{id}

Find the legal entity given by id. Returns 200.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Request
GET/api/v2/legal-entities/{id}
curl https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08 \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": {
    "id": "6698d912deb64c8b2fec2c08",
    "type": "legal-entity",
    "attributes": {
      "name": "Company 1"
    },
    "relationships": {
      "accounts": {
        "data": [
          { "type": "account", "id": "6698de390fb223343ef3b648" },
          { "type": "account", "id": "6698de390fb223343ef3b649" },
          { "type": "account", "id": "6698de437583af24db430e51" },
          { "type": "account", "id": "6699ec9eed2e23e9f214ba6f" }
        ]
      },
      "client": {
        "data": { "type": "client", "id": "9d328abedbe8c8afabeffc69" }
      },
      "depositories": {
        "data": [
          { "type": "depository", "id": "6698debff36caf2dcef8d217" },
          { "type": "depository", "id": "6698dec1f0dc7dd7e2fdedc1" }
        ]
      }
    }
  }
}

POST/api/v2/clients/{id}/legal-entities

Create a legal entity owned by the client given by id. Returns 201.

Path parameters

idstring

Client identifier, see GET /clients. Required.

Request
POST/api/v2/clients/{id}/legal-entities
curl -X POST https://api.aleta.ai/api/v2/clients/6698d912deb64c8b2fec2c08/legal-entities \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "legal-entity",
      "attributes": {
        "name": "New legal entity"
      }
    }
  }'
Response
{
  "data": {
    "id": "66991be2f9bcbf6057b61a53",
    "type": "legal-entity",
    "attributes": {
      "name": "New legal entity"
    },
    "relationships": {
      "client": {
        "data": { "type": "client", "id": "6698d912deb64c8b2fec2c08" }
      },
      "accounts": {
        "data": []
      },
      "depositories": {
        "data": []
      }
    }
  }
}

PATCH/api/v2/legal-entities/{id}

Update the legal entity given by id.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Request
PATCH/api/v2/legal-entities/{id}
curl -X PATCH https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08 \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "id": "6698d912deb64c8b2fec2c08",
      "type": "legal-entity",
      "attributes": {
        "name": "Company 1"
      }
    }
  }'

DELETE/api/v2/legal-entities/{id}

Delete the legal entity given by id. Returns 204 with no body.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Request
DELETE/api/v2/legal-entities/{id}
curl -X DELETE https://api.aleta.ai/api/v2/legal-entities/d09dff6403a7a771cace9a9f \
  -H "Authorization: Bearer {access_token}"

GET/api/v2/legal-entities/{id}/accounts

List accounts

Get accounts owned by the legal entity given by id. Returns 200.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Request
GET/api/v2/legal-entities/{id}/accounts
curl https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08/accounts \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": [
    {
      "id": "6698de390fb223343ef3b648",
      "type": "account",
      "attributes": {
        "name": "Trading account (DKK)",
        "externalIdentifier": "49469412",
        "ccyCode": "DKK",
        "excludeFromReporting": false
      },
      "relationships": {
        "depository": {
          "data": { "type": "depository", "id": "6698debff36caf2dcef8d217" }
        },
        "depositories": {
          "data": [{ "type": "depository", "id": "6698debff36caf2dcef8d217" }]
        },
        "legalEntity": {
          "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
        }
      }
    },
    {
      "id": "6698de390fb223343ef3b649",
      "type": "account",
      "attributes": {
        "name": "Trading account (USD)",
        "externalIdentifier": "49464598",
        "ccyCode": "USD",
        "excludeFromReporting": false
      },
      "relationships": {
        "depository": {
          "data": { "type": "depository", "id": "6698debff36caf2dcef8d217" }
        },
        "depositories": {
          "data": [{ "type": "depository", "id": "6698debff36caf2dcef8d217" }]
        },
        "legalEntity": {
          "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
        }
      }
    },
    {
      "id": "6698de437583af24db430e51",
      "type": "account",
      "attributes": {
        "name": "Mutual Funds account (EUR)",
        "externalIdentifier": "52056091",
        "ccyCode": "EUR",
        "excludeFromReporting": false
      },
      "relationships": {
        "depository": {
          "data": { "type": "depository", "id": "6698debff36caf2dcef8d217" }
        },
        "depositories": {
          "data": [{ "type": "depository", "id": "6698debff36caf2dcef8d217" }]
        },
        "legalEntity": {
          "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
        }
      }
    },
    {
      "id": "6699ec9eed2e23e9f214ba6f",
      "type": "account",
      "attributes": {
        "name": "Money Market account (DKK)",
        "externalIdentifier": "23074547",
        "ccyCode": "DKK",
        "excludeFromReporting": false
      },
      "relationships": {
        "depositories": {
          "data": []
        },
        "legalEntity": {
          "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
        }
      }
    }
  ]
}

GET/api/v2/accounts/{id}

Retrieve an account

Get account given by id. Returns 200.

Path parameters

idstring

Account identifier, see GET /legal-entities/:id/accounts. Required.

Request
GET/api/v2/accounts/{id}
curl https://api.aleta.ai/api/v2/accounts/6698de390fb223343ef3b648 \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": {
    "id": "6698de390fb223343ef3b648",
    "type": "account",
    "attributes": {
      "name": "Trading account (DKK)",
      "externalIdentifier": "49469412",
      "ccyCode": "DKK",
      "excludeFromReporting": false
    },
    "relationships": {
      "depository": {
        "data": { "type": "depository", "id": "6698debff36caf2dcef8d217" }
      },
      "depositories": {
        "data": [{ "type": "depository", "id": "6698debff36caf2dcef8d217" }]
      },
      "legalEntity": {
        "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
      }
    }
  }
}

POST/api/v2/legal-entities/{id}/accounts

Create an account

Create a new account owned by the legal entity given by id. Returns 201. The name attribute must be present in the request body; it may be null.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Create account
POST/api/v2/legal-entities/{id}/accounts
curl -X POST https://api.aleta.ai/api/v2/legal-entities/66991be2f9bcbf6057b61a53/accounts \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "account",
      "attributes": {
        "name": "USD Account",
        "externalIdentifier": "23073214",
        "ccyCode": "USD"
      }
    }
  }'
Response
{
  "data": {
    "id": "6699ec9eed2e23e9f231ad8t",
    "type": "account",
    "attributes": {
      "name": "USD Account",
      "externalIdentifier": "23073214",
      "ccyCode": "USD",
      "excludeFromReporting": false
    },
    "relationships": {
      "depository": null,
      "depositories": {
        "data": []
      },
      "legalEntity": {
        "data": { "type": "legal-entity", "id": "66991be2f9bcbf6057b61a53" }
      }
    }
  }
}
Create account linked to a depository
POST/api/v2/legal-entities/{id}/accounts
curl -X POST https://api.aleta.ai/api/v2/legal-entities/66991be2f9bcbf6057b61a53/accounts \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "account",
      "attributes": {
        "name": "Trading Account (DKK)",
        "externalIdentifier": "23074547",
        "ccyCode": "DKK"
      },
      "relationships": {
        "depository": {
          "data": { "type": "depository", "id": "6698debff36caf2dcef8d217" }
        }
      }
    }
  }'
Response
{
  "data": {
    "id": "6699ec9eed2e23e9f214ba6f",
    "type": "account",
    "attributes": {
      "name": "Trading Account (DKK)",
      "externalIdentifier": "23074547",
      "ccyCode": "DKK",
      "excludeFromReporting": false
    },
    "relationships": {
      "depository": {
        "data": { "type": "depository", "id": "6698debff36caf2dcef8d217" }
      },
      "depositories": {
        "data": [{ "type": "depository", "id": "6698debff36caf2dcef8d217" }]
      },
      "legalEntity": {
        "data": { "type": "legal-entity", "id": "66991be2f9bcbf6057b61a53" }
      }
    }
  }
}

PATCH/api/v2/accounts/{id}

Update an account

Update the account given by id. Returns 204 with no body.

Path parameters

idstring

Account identifier, see GET /legal-entities/:id/accounts. Required.

Request
PATCH/api/v2/accounts/{id}
curl -X PATCH https://api.aleta.ai/api/v2/accounts/6698de390fb223343ef3b648 \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "id": "6698de390fb223343ef3b648",
      "type": "account",
      "attributes": {
        "name": "Trading account (DKK)",
        "externalIdentifier": "49469412",
        "ccyCode": "DKK"
      }
    }
  }'

DELETE/api/v2/accounts/{id}

Delete an account

Delete the account given by id. Returns 204 with no body.

Path parameters

idstring

Account identifier, see GET /legal-entities/:id/accounts. Required.

Request
DELETE/api/v2/accounts/{id}
curl -X DELETE https://api.aleta.ai/api/v2/accounts/8ecedfc7edbc0e6f1caa8d0d \
  -H "Authorization: Bearer {access_token}"

GET/api/v2/legal-entities/{id}/depositories

List depositories

Get depositories owned by the legal entity given by id. Returns 200.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Request
GET/api/v2/legal-entities/{id}/depositories
curl https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08/depositories \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": [
    {
      "id": "6698debff36caf2dcef8d217",
      "type": "depository",
      "attributes": {
        "name": "Open depository",
        "externalIdentifier": "85939780"
      },
      "relationships": {
        "legalEntity": {
          "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
        },
        "accounts": {
          "data": [{ "type": "account", "id": "66f400e7d6b1fe5d6cddc4a4" }]
        }
      }
    },
    {
      "id": "6698dec1f0dc7dd7e2fdedc1",
      "type": "depository",
      "attributes": {
        "name": "Mutual funds depository",
        "externalIdentifier": "00873894"
      },
      "relationships": {
        "legalEntity": {
          "data": { "type": "legal-entity", "id": "6698d912deb64c8b2fec2c08" }
        },
        "accounts": {
          "data": [{ "type": "account", "id": "66f4010eba1092a499deb84c" }]
        }
      }
    }
  ]
}

GET/api/v2/depositories/{id}

Retrieve a depository

Get depository given by id. Returns 200.

Path parameters

idstring

Depository identifier, see GET /legal-entities/:id/depositories. Required.

Request
GET/api/v2/depositories/{id}
curl https://api.aleta.ai/api/v2/depositories/6698debff36caf2dcef8d217 \
  -H "Authorization: Bearer {access_token}"
Response
{
  "data": {
    "id": "6698debff36caf2dcef8d217",
    "type": "depository",
    "attributes": {
      "name": "Open depository",
      "externalIdentifier": "85939780"
    },
    "relationships": {
      "legalEntity": {
        "data": { "type": "legal-entity", "id": "ffb5888c92a060b1f4dc5763" }
      },
      "accounts": {
        "data": [{ "type": "account", "id": "66f4018d188042cfeb09706b" }]
      }
    }
  }
}

POST/api/v2/legal-entities/{id}/depositories

Create a depository

Create a new depository owned by the legal entity given by id. Returns 201. The name attribute must be present in the request body; it may be null.

Path parameters

idstring

Legal entity identifier, see GET /clients/:id/legal-entities. Required.

Request
POST/api/v2/legal-entities/{id}/depositories
curl -X POST https://api.aleta.ai/api/v2/legal-entities/66991be2f9bcbf6057b61a53/depositories \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "depository",
      "attributes": {
        "name": "Open depository",
        "externalIdentifier": "85939780"
      },
      "relationships": {
        "accounts": {
          "data": [{ "type": "account", "id": "66f4010eba1092a499deb84c" }]
        }
      }
    }
  }'
Response
{
  "data": {
    "id": "6699ed355c077cba345a8a2c",
    "type": "depository",
    "attributes": {
      "name": "Open depository",
      "externalIdentifier": "85939780"
    },
    "relationships": {
      "legalEntity": {
        "data": { "type": "legal-entity", "id": "66991be2f9bcbf6057b61a53" }
      },
      "accounts": {
        "data": [{ "type": "account", "id": "66f4010eba1092a499deb84c" }]
      }
    }
  }
}

PATCH/api/v2/depositories/{id}

Update a depository

Update the depository given by id. Returns 204 with no body.

Path parameters

idstring

Depository identifier, see GET /legal-entities/:id/depositories. Required.

Request
PATCH/api/v2/depositories/{id}
curl -X PATCH https://api.aleta.ai/api/v2/depositories/6698debff36caf2dcef8d217 \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "id": "6698debff36caf2dcef8d217",
      "type": "depository",
      "attributes": {
        "name": "Open depository",
        "externalIdentifier": "85939780"
      }
    }
  }'

DELETE/api/v2/depositories/{id}

Delete a depository

Delete the depository given by id. Returns 204 with no body.

Path parameters

idstring

Depository identifier, see GET /legal-entities/:id/depositories. Required.

Request
DELETE/api/v2/depositories/{id}
curl -X DELETE https://api.aleta.ai/api/v2/depositories/affb314b2daebab0aef5b05f \
  -H "Authorization: Bearer {access_token}"