Skip to content

lt.identifiers

lt.identifiers pairs a scanned value (raw) with the thing it stands for (target), under one scan scheme. A value has one live target at a time; retired bindings are kept as history. See Identifier bindings for binders, exclusive targets and the bind scan step.

Reading takes no auth context. Binding, rebinding and retiring take one, and the caller must hold role management or a role the scheme names in identifier.binders; anyone else gets 403.

const result = await lt.identifiers.listBindings({ scheme: 22, target: 'PRN-007' });
// result.data.bindings → [{ id, scheme_version, raw, target, exclusive, bound_by, bound_via, bound_at, retired_at, retired_by }]

A scheme’s live bindings, newest first.

Parameters

FieldTypeRequiredDescription
schemenumberYesThe scan scheme the bindings are kept under
rawstringNoA scanned value: answers its live target
targetstringNoA target: the values bound to it
includeRetiredbooleanNoRetired bindings too
limitnumberNo1 to 500, default 100
offsetnumberNoRows to skip

Returns: LTApiResult<{ bindings }>

const result = await lt.identifiers.bind({ scheme: 22, raw: 'PL-0193', target: 'PRN-007' });

Pairs a value with a target. Under a scheme with identifier.exclusiveTarget, the target’s old value is retired in the same transaction.

FieldTypeRequiredDescription
schemenumberYesScan scheme version
rawstringYesThe scanned value
targetstringYesWhat it stands for

Returns: LTApiResult<{ binding, already, retired }>: 201 bound; 200 when the pair already stands; 409 when the value is bound to another target.

const result = await lt.identifiers.rebind({ scheme: 22, raw: 'PL-0193', target: 'PRN-012' });

Moves a value to a new target. Its old binding (and, under an exclusive scheme, the target’s old value) is retired and the new one inserted in one transaction. Same parameters as bind.

Returns: LTApiResult<{ binding, already, retired }> with status 200.

const result = await lt.identifiers.retire({ scheme: 22, id: '41' });

Ends one live binding. It stays as history, and the value is free to bind again.

FieldTypeRequiredDescription
schemenumberYesScan scheme version
idstringYesThe binding id

Returns: LTApiResult<IdentifierBinding>: 200 with the retired binding; 404 when no live binding has that id under the scheme.