# Accept (/api/events/applications/accept)



## Event Type [#event-type]

```ts
"application.accept"
```

## Description [#description]

This event is triggered when a staff member accepts 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.accept",
  "payload": {
    "applicationId": "APP-5678",
    "panelId": "staff-application",
    "submitterId": "713115896805064856",
    "submitDate": "2024-01-18T15:30:00.000Z",
    "reviewerId": "280158289667555328",
    "reviewDate": 1705594800000,
    "reason": "Great qualifications and experience!"
  }
}
```

## Example Usage [#example-usage]

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

  if (type === 'application.accept') {
    console.log(`Application ${payload.applicationId} accepted!`);
    console.log(`Reviewer: ${payload.reviewerId}`);
    console.log(`Reason: ${payload.reason}`);
    
    const reviewTime = payload.reviewDate - new Date(payload.submitDate).getTime();
    const hoursToReview = Math.floor(reviewTime / (1000 * 60 * 60));
    
    console.log(`Review time: ${hoursToReview} hours`);
    
    // Update application status
    await updateApplicationStatus({
      id: payload.applicationId,
      status: 'accepted',
      reviewerId: payload.reviewerId,
      reviewedAt: new Date(payload.reviewDate),
      reason: payload.reason,
    });
    
    // Notify the applicant
    await notifyApplicant(payload.submitterId, 'accepted', payload.reason);
    
    // Grant roles or permissions
    await grantNewMemberRole(payload.submitterId, payload.panelId);
  }

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

## Use Cases [#use-cases]

* Automatically grant Discord roles to accepted applicants
* Update application status in external HR systems
* Send custom acceptance messages or emails
* Track acceptance rates and review times
* Trigger onboarding workflows
* Generate analytics on application success
