> ## Documentation Index
> Fetch the complete documentation index at: https://doc.raliopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# KYC Session Verified

> Webhook event fired when a KYC verification session is successfully completed

<Info>
  **Event Name:** `kyc_session_verified`
</Info>

<Note>
  This event indicates that the entity has passed all required verification checks and the session has been successfully verified. The session state is `VERIFIED`.
</Note>

## Event Payload

The webhook payload contains the following structure:

<CodeGroup>
  ```json Example Payload (User) theme={null}
  {
    "eventId": "36f6bb7e-e5da-4278-9ad8-df64c8c4cd22",
    "eventType": "kyc_session_verified",
    "timestamp": "2026-03-17T16:35:12.501Z",
    "data": {
      "sessionId": "66062076-d3b7-470b-b5ca-cf9b92ad6b0e",
      "userId": "15299b4e-8af7-4716-8695-0bf1d0579944",
      "entityType": "user"
    }
  }
  ```

  ```json Example Payload (Related Party) theme={null}
  {
    "eventId": "23f44c67-f552-4d7a-a41a-b6790c46ee72",
    "eventType": "kyc_session_verified",
    "timestamp": "2026-03-17T16:37:44.119Z",
    "data": {
      "sessionId": "953a82b9-8f2a-4be4-bbb6-cd2f85c56f07",
      "relatedPartyId": "4d5a5b5c-af11-4d48-ad4d-b7806fa7d98e",
      "entityType": "related-party"
    }
  }
  ```
</CodeGroup>

## Field Description

<ParamField path="eventId" type="string" required>
  Unique event identifier (UUID)
</ParamField>

<ParamField path="eventType" type="string" required>
  Event type - always `kyc_session_verified` for this webhook
</ParamField>

<ParamField path="timestamp" type="string" required>
  Event timestamp in ISO 8601 format
</ParamField>

<ParamField path="data" type="object" required>
  Contains the event data
</ParamField>

<ParamField path="data.sessionId" type="string" required>
  Unique KYC session ID (UUID)
</ParamField>

<ParamField path="data.userId" type="string">
  Unique user ID (UUID)
</ParamField>

<ParamField path="data.relatedPartyId" type="string">
  Unique related party ID (UUID)
</ParamField>

<ParamField path="data.entityType" type="string" required>
  Entity type associated with the KYC session. Possible values: `user`, `related-party`
</ParamField>

## Expected Responses

<CardGroup cols={3}>
  <Card title="Success Response" icon="circle-check" color="#16a34a">
    **HTTP 200 OK**

    The webhook was processed successfully.
  </Card>

  <Card title="Client Error" icon="triangle-exclamation" color="#ea580c">
    **HTTP 4xx Status**

    Client-side error. Will not be retried.
  </Card>

  <Card title="Server Error" icon="circle-xmark" color="#dc2626">
    **HTTP 5xx Status**

    Server-side error. Will be retried with exponential backoff.
  </Card>
</CardGroup>

## Implementation Example

<CodeGroup>
  ```javascript Node.js theme={null}
  app.post('/webhooks/ralio', async (req, res) => {
    const { eventType, data } = req.body;

    if (eventType === 'kyc_session_verified') {
      const { sessionId, entityType, userId, relatedPartyId } = data;
      const subjectId = userId ?? relatedPartyId;

      console.log(`KYC session ${sessionId} verified for ${entityType} ${subjectId}`);

      await updateKycSessionStatus(sessionId, 'VERIFIED');

      if (entityType === 'user' && userId) {
        await notifyUserVerificationSuccess(userId);
      }

      if (entityType === 'related-party' && relatedPartyId) {
        await notifyRelatedPartyVerificationSuccess(relatedPartyId);
      }

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

  ```python Python theme={null}
  @app.route('/webhooks/ralio', methods=['POST'])
  def handle_webhook():
      payload = request.get_json()

      if payload['eventType'] == 'kyc_session_verified':
          data = payload['data']
          session_id = data['sessionId']
          entity_type = data['entityType']
          user_id = data.get('userId')
          related_party_id = data.get('relatedPartyId')
          subject_id = user_id or related_party_id
          print(f"KYC session {session_id} verified for {entity_type} {subject_id}")
          update_kyc_session_status(session_id, 'VERIFIED')

          if entity_type == 'user' and user_id:
              notify_user_verification_success(user_id)

          if entity_type == 'related-party' and related_party_id:
              notify_related_party_verification_success(related_party_id)

          return jsonify({'received': True}), 200
  ```

  ```go Go theme={null}
  func handleWebhook(w http.ResponseWriter, r *http.Request) {
      var payload struct {
          EventType string `json:"eventType"`
          Data  struct {
              SessionID      string `json:"sessionId"`
              UserID         string `json:"userId"`
              RelatedPartyID string `json:"relatedPartyId"`
              EntityType     string `json:"entityType"`
          } `json:"data"`
      }

      if err := json.NewDecoder(r.Body).Decode(&payload); err != nil {
          http.Error(w, "Invalid JSON", http.StatusBadRequest)
          return
      }

      if payload.EventType == "kyc_session_verified" {
          subjectID := payload.Data.UserID
          if subjectID == "" {
              subjectID = payload.Data.RelatedPartyID
          }

          log.Printf("KYC session %s verified for %s %s", payload.Data.SessionID, payload.Data.EntityType, subjectID)

          if err := updateKycSessionStatus(payload.Data.SessionID, "VERIFIED"); err != nil {
              http.Error(w, "Internal error", http.StatusInternalServerError)
              return
          }

          if payload.Data.EntityType == "user" && payload.Data.UserID != "" {
              if err := notifyUserVerificationSuccess(payload.Data.UserID); err != nil {
                  http.Error(w, "Internal error", http.StatusInternalServerError)
                  return
              }
          }

          if payload.Data.EntityType == "related-party" && payload.Data.RelatedPartyID != "" {
              if err := notifyRelatedPartyVerificationSuccess(payload.Data.RelatedPartyID); err != nil {
                  http.Error(w, "Internal error", http.StatusInternalServerError)
                  return
              }
          }

          w.Header().Set("Content-Type", "application/json")
          w.WriteHeader(http.StatusOK)
          json.NewEncoder(w).Encode(map[string]bool{"received": true})
      }
  }
  ```
</CodeGroup>
