Overview
Thecredential event is triggered when a credential is accepted or rejected by the user. The event includes the full W3C Verifiable Credential with cryptographic proofs, enabling verification and audit.
Example Payload
Base Fields
All credential events include these common fields:| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | Always "credential" |
requestId | string | Yes | Request identifier |
internalId | string | No | Your internal identifier for the request |
issuerDid | string | Yes | DID of the organization/issuer |
user | object | Yes | Object containing user identity fields |
decisionDate | Date | Yes | Timestamp when the credential decision was made |
User Object
| Field | Type | Required | Description |
|---|---|---|---|
contact | string | Yes | User’s contact information (phone or email) |
did | string | Yes | DID of the user/subject |
internalId | string | No | Your internal identifier for the user |
Credential-Specific Fields
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | User’s action: "accept" or "reject" |
credential | W3CVerifiableCredential | Yes | Full W3C Verifiable Credential with proofs |
Action Types
| Action | Description |
|---|---|
accept | User accepted and signed the credential |
reject | User explicitly rejected the credential |
W3C Verifiable Credential Structure
Thecredential field contains a full W3C VC 2.0 compliant credential:
| Field | Type | Required | Description |
|---|---|---|---|
@context | string[] or string | Yes | JSON-LD context(s) |
id | string | Yes | Unique credential identifier |
type | string[] or string | Yes | Credential type(s) |
issuer | string | Yes | DID of the issuer |
validFrom | string | No | Start of validity period (ISO 8601) |
validUntil | string | No | End of validity period (ISO 8601) |
credentialSubject | CredentialSubject | Yes | The credential data and subject |
proof | W3CProof or W3CProof[] | No | Cryptographic proof(s) |
getEndpoint | string | No | API endpoint to retrieve full credential details |
Credential Subject
ThecredentialSubject contains the actual credential data:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | DID of the subject |
data | MandateDataDto[] | Yes | Array of data fields |
Mandate Data Structure
Each item in thedata array follows this structure:
| Field | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Human-readable label for the field |
type | string | Yes | Data type: string, number, boolean, object, array, date, pdf |
value | any | Yes | The actual value |
hash | string | No | Hash of the value for integrity verification |
description | string | No | Additional description |
hidden | boolean | No | Whether the field should be hidden |
fields | MandateDataDto[] | No | Nested fields (for object type) |
W3C Proof Structure
Theproof field contains the cryptographic proof following W3C Data Integrity:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Proof type (e.g., "DataIntegrityProof") |
cryptosuite | string | Yes | Cryptographic suite used |
proofPurpose | string | Yes | Purpose (e.g., "assertionMethod") |
verificationMethod | string | Yes | DID URL of the verification key |
proofValue | string | Yes | The cryptographic proof value |
actionType | string | Yes | Action taken: "accept" or "reject" |
actionProof | string | Yes | Proof of the action |
createdAt | string | Yes | Timestamp of proof creation (ISO 8601) |