persona.startInquiry
Start a Persona inquiry
Creates a Persona inquiry for a reference ID and returns a one-time link to its hosted KYC flow.
Usage
import * as from 'mppx/extensions/identity/persona'
declare const : string // From verifyWallet, not an untrusted request field.
const = ..({
: ..!,
: 'itmpl_example',
})
const { , } = await .({
: 'https://api.example.com/kyc/complete',
,
})
Authenticate the person and verify wallet ownership before starting KYC with a wallet DID. Otherwise someone can pass KYC for another person's wallet. Store that reference ID in your authenticated session for later checks.
Return type
Promise<Persona.StartedInquiry>:
type StartedInquiry = {
inquiryId: string
url: string
}The SDK creates the inquiry, then calls its generate-one-time-link endpoint. Completing the hosted flow doesn't by itself mean the inquiry is approved; your Persona workflow or reviewer decides that status.
Parameters
redirectUri (optional)
- Type:
string
Where Persona sends the person after the hosted flow. Use a trusted return URL, not an unchecked caller-supplied redirect.
referenceId
- Type:
string
Identifier matched by subsequent lookups, such as the DID returned by verifyWallet. This method doesn't verify wallet ownership or normalize the value.
templateId (optional)
- Type:
string - Default: The client's configured
templateId.
Template to start this inquiry from. Overrides the client for creation only, not its lookup filter; a different template isn't accepted by checks configured for the original one.
Errors
- Throws
TypeErrorfor an emptyreferenceIdor no effectivetemplateId. - Throws
Persona.Server.PersonaErrorfor non-success API responses, including redirects, or missing string inquiry ID or hosted link. - Network, timeout, and JSON parsing errors propagate. Upstream response bodies aren't included in
PersonaErrormessages.