# Fail (/api/events/verification/fail)



## Event Type [#event-type]

```ts
"verification.fail"
```

## Description [#description]

This event is triggered when a user fails the verification process.

## Payload Structure [#payload-structure]

<TypeTable
  type="{
  verificationId: {
    description: 'Unique identifier for the verification attempt',
    type: 'string',
  },
  userId: {
    description: 'Discord user ID of who attempted verification',
    type: 'string',
  },
  status: {
    description: 'New verification status (will be &#x22;FAILED&#x22;)',
    type: 'string',
  },
}"
/>

## Example Payload [#example-payload]

```json
{
  "type": "verification.fail",
  "payload": {
    "verificationId": "VER-9013",
    "userId": "713115896805064856",
    "status": "FAILED"
  }
}
```

## Example Usage [#example-usage]

```ts
app.post('/webhook', (req, res) => {
  const { type, payload } = req.body;

  if (type === 'verification.fail') {
    console.log(`User ${payload.userId} failed verification`);
    console.log(`Verification ID: ${payload.verificationId}`);
    
    // Update user status in your database
    await updateUserStatus({
      userId: payload.userId,
      verified: false,
      verificationId: payload.verificationId,
      failedAt: new Date(),
    });
    
    // Track failed verification attempts
    await incrementFailedAttempts(payload.userId);
    
    // Check if user should be kicked/banned
    const attempts = await getFailedAttempts(payload.userId);
    if (attempts >= 3) {
      await handleRepeatedFailures(payload.userId);
    }
    
    // Alert moderators if suspicious activity
    await checkForSuspiciousActivity(payload.userId, payload.verificationId);
  }

  res.status(200).send('OK');
});
```

## Use Cases [#use-cases]

* Track verification failure rates
* Monitor potential bot or spam accounts
* Implement progressive security measures
* Alert moderators of repeated failures
* Analyze verification difficulty and adjust accordingly
* Log failures for security auditing
