# The event model

Source: https://developers.swell.is/backend-api/events/the-event-model

## Fields

- `id` (objectId): The unique identifier for the event.
- `date_created` (date, auto): Date and time the event was created.
- `date_updated` (date, auto): Date and time the event was updated.
- `app_id` (objectId): ID of the app that generated the event, if applicable.
- `model` (string, required): The name of the model for which the events are associated.
- `type` (string, required): The trigger type for the event.
- `data` (object): The data or payload of the event.
  - `id` (objectId): The unique identifier for the event data object.
- `notes` (string): Notes stored on the event's webhook.
- `req_id` (objectId): ID of the request that triggered the event.
- `user_id` (objectId): ID of the user that configured the webhook which triggers the event.
- `webhooks_pending` (int): The number of webhooks still pending to fire.
- `webhooks` (array of Webhooks): An array of pending webhooks

## Example request

**The event model**

## Example response

```json
{
  "model": "accounts",
  "type": "account.created",
  "data": {
    "email": "martinseptim@waynonpriory.net",
    "first_name": "Martin",
    "last_name": "Septim",
    "password": "theblades123",
    "email_optin": true,
    "currency": "USD",
    "name": "Martin Septim",
    "date_created": "2022-06-27T03:39:45.152Z",
    "type": "individual",
    "order_count": 0,
    "order_value": 0,
    "balance": 0,
    "id": "62b9268145139e0019e246ca"
  },
  "date_created": "2022-06-27T03:39:45.461Z",
  "date_updated": "2022-06-27T03:39:45.875Z",
  "webhooks_pending": 0,
  "id": "62b9268145139e0019e246cb"
}
```
