Command Palette

Search for a command to run...

API Reference

Events

Retrieve webhook events and email activity history. Events track opens, clicks, bounces, and delivery status changes.

Delivery Events

Sent, delivered, bounced

Opens

Track email opens

Clicks

Link click tracking

Complaints

Spam reports

GET/v1/events

Get Email Events

Retrieve email events including delivery confirmations, opens, clicks, bounces, and complaints. Useful for tracking engagement and debugging delivery issues.

Query Parameters

ParameterTypeDescription
email_idstringFilter events for a specific email
event_typestringFilter by type: sent, delivered, opened, clicked, bounced, complained
daysnumberNumber of days to look back (1-90). Default: 7
limitnumberNumber of results (1-100). Default: 50
offsetnumberPagination offset. Default: 0

Request

cURL
curl "https://www.unosend.co/api/v1/events?days=7&limit=50" \
  -H "Authorization: Bearer un_your_api_key"

Response

200 OK
{
  "success": true,
  "data": {
    "data": [
      {
        "id": "evt_abc123",
        "email_id": "email_xyz789",
        "type": "opened",
        "metadata": {
          "user_agent": "Mozilla/5.0...",
          "ip_address": "192.168.1.1"
        },
        "created_at": "2024-12-01T14:30:00.000Z",
        "email": {
          "to": ["user@example.com"],
          "subject": "Welcome to our platform"
        }
      },
      {
        "id": "evt_abc124",
        "email_id": "email_xyz789",
        "type": "clicked",
        "metadata": {
          "url": "https://example.com/activate",
          "user_agent": "Mozilla/5.0..."
        },
        "created_at": "2024-12-01T14:32:00.000Z",
        "email": {
          "to": ["user@example.com"],
          "subject": "Welcome to our platform"
        }
      }
    ],
    "pagination": {
      "total": 89,
      "limit": 50,
      "offset": 0,
      "has_more": true
    },
    "filters": {
      "email_id": null,
      "event_type": null,
      "days": 7
    }
  }
}

Event Object Fields

FieldTypeDescription
idstringUnique event identifier
email_idstringID of the associated email
typestringEvent type (see table below)
metadataobjectAdditional event data (varies by type)
created_atstringWhen the event occurred (ISO 8601)
emailobjectAssociated email info (to, subject)

Event Types

TypeDescriptionMetadata
sentEmail was sent to the mail servermessage_id
deliveredEmail was successfully deliveredsmtp_response
openedRecipient opened the emailuser_agent, ip_address
clickedRecipient clicked a linkurl, user_agent
bouncedEmail bounced (hard or soft)bounce_type, reason
complainedRecipient marked as spamcomplaint_type
unsubscribedRecipient unsubscribed

Example Queries

Get all opens

cURL
curl "https://www.unosend.co/api/v1/events?event_type=opened&days=30" \
  -H "Authorization: Bearer un_your_api_key"

Get events for specific email

cURL
curl "https://www.unosend.co/api/v1/events?email_id=email_abc123" \
  -H "Authorization: Bearer un_your_api_key"

Get all link clicks

cURL
curl "https://www.unosend.co/api/v1/events?event_type=clicked&days=7" \
  -H "Authorization: Bearer un_your_api_key"

Get bounces for analysis

cURL
curl "https://www.unosend.co/api/v1/events?event_type=bounced&days=90&limit=100" \
  -H "Authorization: Bearer un_your_api_key"

Events API vs Webhooks

Events API (Pull)

  • • Query historical events on demand
  • • Good for analytics and reporting
  • • Paginated results
  • • Up to 90 days of history

Webhooks (Push)

  • • Real-time event notifications
  • • Good for triggers and automation
  • • Requires endpoint setup
  • • Events delivered as they happen