Events

Events are a core part of Emailit. On this page, we'll dive into the different event endpoints you can use to manage events programmatically. We'll look at how to query events.

The event model

The event model contains all the information about your event.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the event.

  • Name
    uuid
    Type
    string
    Description

    UUID of the event.

  • Name
    type
    Type
    string
    Description

    Type of the event.

  • Name
    data
    Type
    object
    Description

    Data of the event.

  • Name
    created_at
    Type
    date
    Description

    The timestamp of when the event was created.

  • Name
    updated_at
    Type
    date
    Description

    The timestamp of when the event was last updated.


GET/v1/events

List all events

This endpoint allows you to retrieve a paginated list of all your events. By default, a maximum of 25 events are shown per page.

Optional attributes

  • Name
    per_page
    Type
    integer
    Description

    Limit the number of events returned.

  • Name
    page
    Type
    integer
    Description

    The page number to retrieve.

  • Name
    filter[type]
    Type
    string
    Description

    Filter events by type.

Request

GET
/v1/events
curl -G https://api.emailit.com/v1/events \
   -H 'Authorization: Bearer {api_key}' \
   -H 'Content-Type: application/json' \
   -d $'{
     "per_page": 25,
     "page": 1,
     "filter[type]": "email.delivery.sent",
   }'

Response

{
  "data": [
    {
      "id": "WAz8eIbvDR60rouK",
      "uuid": "123e4567-e89b-12d3-a456-426614174000",
      "type": "email.delivery.sent",
      "data": {
        
      },
      "created_at": "2024-09-26T08:16:03.000000Z",
      "updated_at": "2024-09-26T08:16:03.000000Z"
    }
  ]
}

GET/v1/events/:id

Retrieve an event

This endpoint allows you to retrieve an event by providing their id. Refer to the list at the top of this page to see which properties are included with event objects.

Request

GET
/v1/events/WAz8eIbvDR60rouK
curl https://api.emailit.com/v1/events/WAz8eIbvDR60rouK \
  -H "Authorization: Bearer {api_key}" \
  -H "Content-Type: application/json"

Response

{
  "id": "WAz8eIbvDR60rouK",
  "uuid": "123e4567-e89b-12d3-a456-426614174000",
  "type": "email.delivery.sent",
  "data": {
    
  },
  "created_at": "2024-09-26T08:16:03.000000Z",
  "updated_at": "2024-09-26T08:16:03.000000Z"
}

Was this page helpful?