Accounts: the long-lived record of one end user (or business) that inquiries, verifications and reports attach to. Look an account up by your own reference-id, read its consolidated fields, and merge duplicates.

Functions

add-tag

fn (account-id: Str, tag-name: Str): Map
fn (account-id: Str, tag-name: Str, options: Map): Map

POST /accounts/{id}/add-tag - Add a tag by name.

consolidate-accounts

fn (account-id: Str, source-account-ids: Vec<Str>): Map
fn (account-id: Str, source-account-ids: Vec<Str>, options: Map): Map

POST /accounts/{id}/consolidate - Merge source-account-ids into the account account-id. Their inquiries, verifications and reports move to the target (attributes don't), and each source is archived. A source can be consolidated only once.

create-account

fn (attributes: Map): Map
fn (attributes: Map, opts: Map): Map
fn (attributes: Map, opts: Map, options: Map): Map

POST /accounts - Create an account. attributes (all optional): reference-id (your user id; a duplicate returns 409), account-type-id (acttp_...), account-status, tags, fields (template field keys and plain values; PII). opts.meta passes request meta, e.g. {upsert-by: "reference-id"}.

Example

::persona::accounts/create-account({reference-id: "user-42", tags: ["beta"]})

find-by-reference-id

fn (reference-id: Str): Map?
fn (reference-id: Str, options: Map): Map?

The account (a resource, not a document) with this reference-id, or null when there is none.

get-account

fn (account-id: Str): Map
fn (account-id: Str, opts: Map): Map
fn (account-id: Str, opts: Map, options: Map): Map

GET /accounts/{id} - Retrieve an account. opts takes include and fields as in ::persona::inquiries/get-inquiry.

list-accounts

fn (filters: Map): Map
fn (filters: Map, opts: Map): Map
fn (filters: Map, opts: Map, options: Map): Map

GET /accounts - One page of accounts. The only filter is reference-id; opts takes page-size, after, before.

redact-account

fn (account-id: Str): Map
fn (account-id: Str, options: Map): Map

DELETE /accounts/{id} - Permanently remove the account's PII. Cannot be undone.

update-account

fn (account-id: Str, attributes: Map): Map
fn (account-id: Str, attributes: Map, options: Map): Map

PATCH /accounts/{id} - Update reference-id, account-status, tags or fields.