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.
namestringDisplay name of the legal entity. Required; must not be empty.
Relationships
accountsarray of accountAccounts owned by the legal entity.
clientclientClient that owns the legal entity.
depositoriesarray of depositoryDepositories owned by the legal entity.
Account
JSON:API resource type: account.
namestringOptional naming of the account.
externalIdentifierstringIdentifier given to the account by the bank or custodian. Required.
ccyCodestringISO 4217 representation of the account's currency. Required.
excludeFromReportingbooleanFlag to exclude the account from reporting. Optional. Default is
false, meaning the account is included in reporting.
Relationships
depositorydepositoryThe depository associated with the account.
depositoriesarray of depositoryDepositories linked to the account.
legalEntitylegal-entityThe legal entity that owns the account.
Depository
JSON:API resource type: depository.
namestringOptional naming of the depository.
externalIdentifierstringIdentifier given to the depository by the bank or custodian. Required.
Relationships
legalEntitylegal-entityThe legal entity that owns the depository.
accountsarray of accountAccounts linked to the depository.
List legal entities
Find all legal entities owned by the client given by id. Returns 200.
Path parameters
idstringClient identifier, see
GET /clients. Required.
curl https://api.aleta.ai/api/v2/clients/6698d912deb64c8b2fec2c08/legal-entities \
-H "Authorization: Bearer {access_token}"
{
"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": []
}
}
}
]
}
Retrieve a legal entity
Find the legal entity given by id. Returns 200.
Path parameters
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
curl https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08 \
-H "Authorization: Bearer {access_token}"
{
"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" }
]
}
}
}
}
Create a legal entity
Create a legal entity owned by the client given by id. Returns 201.
Path parameters
idstringClient identifier, see
GET /clients. Required.
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"
}
}
}'
{
"data": {
"id": "66991be2f9bcbf6057b61a53",
"type": "legal-entity",
"attributes": {
"name": "New legal entity"
},
"relationships": {
"client": {
"data": { "type": "client", "id": "6698d912deb64c8b2fec2c08" }
},
"accounts": {
"data": []
},
"depositories": {
"data": []
}
}
}
}
Update a legal entity
Update the legal entity given by id.
Path parameters
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
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 a legal entity
Delete the legal entity given by id. Returns 204 with no body.
Path parameters
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
curl -X DELETE https://api.aleta.ai/api/v2/legal-entities/d09dff6403a7a771cace9a9f \
-H "Authorization: Bearer {access_token}"
List accounts
Get accounts owned by the legal entity given by id. Returns 200.
Path parameters
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
curl https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08/accounts \
-H "Authorization: Bearer {access_token}"
{
"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" }
}
}
}
]
}
Retrieve an account
Get account given by id. Returns 200.
Path parameters
idstringAccount identifier, see
GET /legal-entities/:id/accounts. Required.
curl https://api.aleta.ai/api/v2/accounts/6698de390fb223343ef3b648 \
-H "Authorization: Bearer {access_token}"
{
"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" }
}
}
}
}
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
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
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"
}
}
}'
{
"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" }
}
}
}
}
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" }
}
}
}
}'
{
"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" }
}
}
}
}
Update an account
Update the account given by id. Returns 204 with no body.
Path parameters
idstringAccount identifier, see
GET /legal-entities/:id/accounts. Required.
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 an account
Delete the account given by id. Returns 204 with no body.
Path parameters
idstringAccount identifier, see
GET /legal-entities/:id/accounts. Required.
curl -X DELETE https://api.aleta.ai/api/v2/accounts/8ecedfc7edbc0e6f1caa8d0d \
-H "Authorization: Bearer {access_token}"
List depositories
Get depositories owned by the legal entity given by id. Returns 200.
Path parameters
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
curl https://api.aleta.ai/api/v2/legal-entities/6698d912deb64c8b2fec2c08/depositories \
-H "Authorization: Bearer {access_token}"
{
"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" }]
}
}
}
]
}
Retrieve a depository
Get depository given by id. Returns 200.
Path parameters
idstringDepository identifier, see
GET /legal-entities/:id/depositories. Required.
curl https://api.aleta.ai/api/v2/depositories/6698debff36caf2dcef8d217 \
-H "Authorization: Bearer {access_token}"
{
"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" }]
}
}
}
}
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
idstringLegal entity identifier, see
GET /clients/:id/legal-entities. Required.
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" }]
}
}
}
}'
{
"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" }]
}
}
}
}
Update a depository
Update the depository given by id. Returns 204 with no body.
Path parameters
idstringDepository identifier, see
GET /legal-entities/:id/depositories. Required.
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 a depository
Delete the depository given by id. Returns 204 with no body.
Path parameters
idstringDepository identifier, see
GET /legal-entities/:id/depositories. Required.
curl -X DELETE https://api.aleta.ai/api/v2/depositories/affb314b2daebab0aef5b05f \
-H "Authorization: Bearer {access_token}"