Skip to main content
Event Name: kyc_state_updated
This event is emitted when the overall KYC verification level changes, typically after a verification process is completed, downgraded, or expires.

Event Payload

The webhook payload contains the following structure:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "event": "kyc_state_updated",
  "timestamp": "2025-06-19T17:14:13.123Z",
  "data": {
    "kycId": 12345,
    "userId": "550e8400-e29b-41d4-a716-446655440001",
    "entityType": "user",
    "state": "REGULAR"
  }
}

Field Description

id
string
required
Unique event identifier (UUID)
event
string
required
Event type - always kyc_state_updated for this webhook
timestamp
string
required
Event timestamp in ISO 8601 format
data
object
required
Contains the event data
data.kycId
integer
required
Unique KYC record ID
data.entityType
string
required
Entity type associated with the KYC record. Possible values: user, related-party
data.userId
string
Unique user ID (UUID)
Unique related party ID (UUID)
data.state
string
required
Current KYC level. Common values include REGULAR and LIGHT

When This Event Is Sent

This webhook is sent when the KYC record changes its overall verification level. Typical scenarios include:
  • A verification flow upgrades the entity to REGULAR
  • A review or business rule downgrades the entity to LIGHT
  • A document expiration process updates the KYC level

Expected Responses

Success Response

HTTP 200 OKThe webhook was processed successfully.

Client Error

HTTP 4xx StatusClient-side error. Will not be retried.

Server Error

HTTP 5xx StatusServer-side error. Will be retried with exponential backoff.

Implementation Example

app.post('/webhooks/ralio', async (req, res) => {
  const { event, data } = req.body;

  if (event === 'kyc_state_updated') {
    const { kycId, entityType, userId, relatedPartyId, state } = data;
    const subjectId = userId ?? relatedPartyId;

    console.log(
      `KYC ${kycId} for ${entityType} ${subjectId} changed to ${state}`
    );

    if (entityType === 'user' && userId) {
      await updateUserKycLevel(userId, state);
    }

    if (entityType === 'related-party' && relatedPartyId) {
      await updateRelatedPartyKycLevel(relatedPartyId, state);
    }

    res.status(200).json({ received: true });
  }
});