Overview
Thecredential event is triggered when a credential is completed or rejected. The event includes credential-specific information and metadata that varies based on the credential type.
Example Payload
Base Fields
All credential events include these common fields:| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | Always "credential" |
issuerId | string | Yes | Organization/issuer identifier |
requestId | string | Yes | Request identifier |
subjectId | string | Yes | Subject (user) identifier |
subjectInternalId | string | No | Internal subject identifier |
rejected | boolean | Yes | Whether the credential was rejected |
decisionDate | Date | Yes | Timestamp when the credential decision was made |
Credential-Specific Fields
| Field | Type | Required | Description |
|---|---|---|---|
credentialId | string | Yes | Unique identifier for the credential |
credentialType | string | Yes | Type of credential (see types below) |
internalId | string | No | Internal identifier for the credential |
metadata | object | No | Metadata specific to the credential type |
Credential Types & Metadata
Themetadata structure depends on the credentialType:
Consent Event
WhencredentialType is "consent", metadata follows the ConsentEvent structure:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the consent |
text | string | Yes | Consent text displayed to the user |
required | boolean | Yes | Whether consent is required |
link | string | No | URL to the full consent document |
Signature Event
WhencredentialType is "signature", metadata follows the SignatureEvent structure:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the signature |
url | string | Yes | URL to download the signed document via API |
required | boolean | Yes | Whether signature is required |
Form Event
WhencredentialType is "form", metadata follows the FormEvent structure:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the form |
data | Record<string, any> | Yes | Form field data as key-value pairs |
JSON Event
WhencredentialType is "json", metadata follows the JsonEvent structure:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the JSON data |
data | Record<string, any> | Yes | JSON data as key-value pairs |