Parties
A party is a person or an organisation under a client that owns entities through ownerships. A party sits above the entities it owns: a grant on an entity, a custody account or a cash account does not show its owners, a grant on a party shows that party, and a grant on the client shows the client's parties.
Data model
idstringStable identifier for the party. A UUID — treat it as opaque.
external_reference_idstring or nullYour own reference for the party, unique in the tenant. A party made through this API without one gets
api:followed by a UUID.client_idstringThe client the party belongs to.
namestringThe person's or organisation's name.
kindstringpersonororganisation. Set at creation.country_codestring or nullISO 3166-1 alpha-2 country.
tax_residency_country_codestring or nullISO 3166-1 alpha-2 country of tax residency.
created_atstringWhen the party was recorded, UTC to the second.
originstringlegacyfor a party mirrored from the legacy platform,v1for one made through this API.
Reads need structure:read or access:read; writes need structure:write or access:write. Every write on this page takes ?dry_run=true and an Idempotency-Key header and is logged in the change list. A party that comes from the legacy platform answers 409 legacy_managed until your move to v1 is done. An unknown body field is 400. A party you cannot see answers 404, like one that doesn't exist. A refusal comes in this order: 400 for the body, then 404, then 403, then 409.
List parties
Every party you can see, by name, in the standard v1 list envelope. An unknown query parameter is a 400.
Query parameters
limitintegerPage size. Defaults to 100, at least 1, capped at 1 000.
cursorstringOpaque cursor from the previous page's
next_cursor. A cursor that does not decode is400.
curl https://api.aleta.ai/v1/parties \
-H "Authorization: Bearer {access_token}"
Create a party
Creates a party under a client you can see; a client you cannot see is 404. It takes a grant that covers the client whole — the tenant, the client or a client above it that includes its sub-clients, or, for an advisor, a current assignment to the client — and is not read-only: a grant on one of its entities, custody accounts or cash accounts, or an auditor's or lens viewer's grant, is 403. Admins and Aleta create everywhere. Returns 201 with the party.
Body parameters
client_idstringThe client the party belongs to. Required.
namestringRequired, not blank.
kindstringpersonororganisation. Required.external_reference_idstringYour own reference, unique in the tenant: one another party has is
409 external_reference_taken. It may not end in:partyor:container(400), which the legacy mirror uses. Left out, the party getsapi:followed by a UUID.country_codestringTwo letters A-Z.
tax_residency_country_codestringTwo letters A-Z.
curl -X POST https://api.aleta.ai/v1/parties \
-H "Authorization: Bearer {access_token}" \
-H "Idempotency-Key: {unique_key}" \
-H "Content-Type: application/json" \
-d '{
"client_id": "019dfeb0-0511-77a7-a8be-a911ab988a0a",
"name": "Anna Hansen",
"kind": "person",
"external_reference_id": "crm-4411",
"country_code": "DK"
}'
Retrieve a party
One party by id. 404 when it doesn't exist or you cannot see it.
curl https://api.aleta.ai/v1/parties/019eb3d2-fc2e-7782-973e-af78d0c10f01 \
-H "Authorization: Bearer {access_token}"
Update a party
Changes a party's name, country or tax residency. A body with none of the three is 400. It takes a grant that covers the party's client whole, as a create does: a grant on the party itself, or an auditor's or lens viewer's grant, is 403. On top of that, only an admin or Aleta changes the name or the tax residency (403 for anyone else). The kind never changes. A change is logged with its reason; a PATCH that changes nothing is not logged. Returns 200 with the party.
Body parameters
namestringNew name, not blank.
country_codestringTwo letters A-Z.
tax_residency_country_codestringTwo letters A-Z.
reasonstringWhy. Required, not blank.
curl -X PATCH https://api.aleta.ai/v1/parties/019eb3d2-fc2e-7782-973e-af78d0c10f01 \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{ "tax_residency_country_code": "SE", "reason": "moved to Sweden" }'
Delete a party
Removes a party nothing refers to. Returns 204, 404 if you cannot see it. It takes a grant that covers the party's client whole, as a create does (403 otherwise). Sent again with the same Idempotency-Key after the party is gone, it answers the first 204 again.
A party that has ever owned an entity, or has any access grant or document, is not deleted: the answer is 409 in_use, its detail names what uses it (Party {id} is used by ownerships, access grants and documents.), and next_action points at the first thing that still blocks it, in this order: an ownership that has not ended (end_date, PATCH /v1/ownerships/{id} with valid_to), a grant that is neither revoked nor expired (archive, DELETE /v1/access-grants/{id}), a document not archived (archive, DELETE /v1/documents/{id}). An ownership that has ended, a revoked or expired grant, or an archived document still keeps the party, with next_action null.
The change list keeps no personal data of a deleted party: only its id, kind and client_id.
curl -X DELETE https://api.aleta.ai/v1/parties/019eb3d2-fc2e-7782-973e-af78d0c10f01 \
-H "Authorization: Bearer {access_token}"