Skip to content

Reference

createUser

Onboard a new user on the validator with an optional fixed party ID via the admin users endpoint.

createUser registers a display name and optionally binds a specific party identifier for validator-managed onboarding flows. Pair it with ledger onboarding (submitAndWait) when you allocate identities programmatically.

Setup

import { Canton } from '@fairmint/canton-node-sdk';

const canton = new Canton({
  network: 'devnet',
  provider: '5n',
  partyId: 'OWN_PARTY_ID',
});

Import and receiver

import { Canton } from '@fairmint/canton-node-sdk';

Receiver: canton.validator.createUser (ValidatorApiClient).

Minimal example

const user = await canton.validator.createUser({
  name: 'Jane Doe',
  party_id: 'Alice::1220abcdef...', // omit to let validator assign party
});

Parameters

Request body fields:

  • name (required, string) — Human-readable user record label stored by the validator.
  • party_id (optional, string) — When provided, asks the validator to associate this party; omit when the allocator should mint the identifier.

Returns

JSON body from the validator onboardUser success response. Exact keys evolve with Canton; expect linkage between the new user row and a party identifier when successful.

Errors and pitfalls

  • Missing name: Validated client-side before the HTTP request is issued.
  • Duplicate binding: Conflicting party_id or policy rejection surfaces as ApiError with validator diagnostics.

Auth and party

Bearer token authorized for validator admin user onboarding routes. This call does not substitute ledger actAs; it configures validator-local identity records.

See also

Source

src/clients/validator-api/operations/v0/admin/create-user.ts on GitHub.