# Deny (/api/events/applications/deny)



## Event Type [#event-type]

```ts
"application.deny"
```

## Description [#description]

This event is triggered when a staff member denies a pending application.

## Payload Structure [#payload-structure]

<TypeTable
  type="{
  applicationId: {
    description: 'Unique identifier for the application',
    type: 'string',
  },
  panelId: {
    description: 'ID of the application panel',
    type: 'string',
  },
  submitterId: {
    description: 'Discord user ID of who submitted the application',
    type: 'string',
  },
  submitDate: {
    description: 'ISO 8601 timestamp when the application was submitted',
    type: 'string',
  },
  reviewerId: {
    description: 'Discord user ID of who reviewed the application',
    type: 'string',
  },
  reviewDate: {
    description: 'Timestamp (milliseconds) when the application was reviewed',
    type: 'number',
  },
  reason: {
    description: 'Reason provided for the decision',
    type: 'string',
  },
}"
/>

## Example Payload [#example-payload]

```json
{
  "type": "application.deny",
  "payload": {
    "applicationId": "APP-5678",
    "panelId": "staff-application",
    "submitterId": "713115896805064856",
    "submitDate": "2024-01-18T15:30:00.000Z",
    "reviewerId": "280158289667555328",
    "reviewDate": 1705594800000,
    "reason": "Not enough experience at this time"
  }
}
```

## Example Usage [#example-usage]

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

  if (type === 'application.deny') {
    console.log(`Application ${payload.applicationId} denied`);
    console.log(`Reviewer: ${payload.reviewerId}`);
    console.log(`Reason: ${payload.reason}`);
    
    // Update application status
    await updateApplicationStatus({
      id: payload.applicationId,
      status: 'denied',
      reviewerId: payload.reviewerId,
      reviewedAt: new Date(payload.reviewDate),
      reason: payload.reason,
    });
    
    // Notify the applicant
    await notifyApplicant(payload.submitterId, 'denied', payload.reason);
    
    // Log for analytics
    await logApplicationDenial({
      applicationId: payload.applicationId,
      panelId: payload.panelId,
      reason: payload.reason,
    });
  }

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

## Use Cases [#use-cases]

* Send constructive feedback to applicants
* Track denial reasons for improvement
* Update application status in external systems
* Analyze common denial patterns
* Manage re-application eligibility
* Generate denial statistics
