GreenArrow Email Software Documentation

Events API

GreenArrow CloudMTA

This feature is only available on GreenArrow CloudMTA. On other installations, this API gives the feature_not_enabled error.

Overview

This API gives the events that GreenArrow stores for its statistics: delivery attempts, bounces, spam complaints, clicks, opens, unsubscribes and more. Each request gives one page of events, newest first. Filters choose the time range, the event types, the recipient, the RFC5321.MailFrom domain, the IP address or relay server, and the throttle.

The Event History page of the web interface reads its events from this API.

With HTTP basic authentication, the Engine user’s API permission must be full access or read-only. From a session of the web interface, the user’s UI permission must be full access or read-only. Users with stats-only or no permission cannot use this API.

Attributes

Each event has the fields that GreenArrow stores for its event type, and these derived fields: event_time (in ISO 8601 format, in place of the stored Unix time), summary, email (for the event types that have a recipient) and throttle (for delivery_attempt events). A field of the event type that has no value is null. The fields of each event type are those that the Event Notification System sends for it (see Types of Events).

The stored fields have the names and meanings that Types of Events gives, with the differences below. The most useful fields are these:

event

hash


id

string

The unique ID of the event, a UUIDv7. Its first 48 bits hold the time of the event in Unix milliseconds. Only the whole second is significant: the milliseconds are random. The events are in order of id, so events in the same second are in no particular order.

event_type

string

The type of the event. It is one of the event types in the event_type[] parameter.

event_time

string

The time of the event, in ISO 8601 format with the UTC offset of the engine_time_zone. For example, 2026-11-05T06:00:00-05:00. This is the stored time, which is a whole second.

null if no time is stored.

email

string

The recipient’s email address. It is built again from email_localpart and email_domain. The domain is in lowercase, so this can differ from the address that the message was sent to. An address with no @ is given as it was stored.

null if no email address is stored.

email_localpart

string

The part of the email address before its last @, as it was sent.

email_domain

string

The part of the email address after its last @, in lowercase.

summary

string

A one-line summary of the event, for people to read. See Event Summaries. Do not parse it: its wording can change.

sender

string

The RFC5321.MailFrom address of the message, as it was sent.

outmtaid

integer

The ID of the IP address or relay server that the delivery used.

outmtaid_name

string

The name of that IP address or relay server, when the event was stored.

outmtaid_ip

string

The IP address that the delivery used, when the event was stored.

outmtaid_hostname

string

The hostname of that IP address, when the event was stored.

throttleid

integer

The ID of the throttle that the delivery attempt used. Only delivery_attempt events have a throttle.

throttle

hash



The throttle that throttleid names. null if the delivery attempt has no throttle. Only delivery_attempt events have this field.

id

integer

The ID of the throttle. This is the same as throttleid.

name

string

The label of the throttle’s throttling rule, for example Throttle Rule for example.com, example.net, example.org…. It gives up to three of the throttle’s domains that its throttling rule also has, in lowercase.

If the throttle no longer exists, this is <id> (deleted).

deleted

boolean

true if the throttle no longer exists.

headers

string

The message headers, as stored. This is a string, also when it holds JSON. The json_before, json_after and smtp_timing fields are strings in the same way.

Get a page of events

GET /ga/api/v3/eng/events

Parameters

Give the parameters in the query string. A blank parameter is the same as one that is not given. Each parameter other than event_type[] takes one value.

start_time

string

/

optional

Give only the events at or after this time.

An ISO 8601 time, such as 2026-11-05T06:00:00-05:00 or 2026-11-05T11:00:00Z. A time with no UTC offset, such as 2026-11-05T06:00:00, is in the engine_time_zone. Fractions of a second are dropped. A time must be from 1970 to 9999 (UTC).

In a query string, a + means a space. So write a + UTC offset as %2B, for example 2026-11-05T12:00:00%2B01:00.

The default is 24 hours before end_time. With a page_token, the default is the start_time of the first page.

end_time

string

/

optional

Give only the events before this time. An event at exactly end_time is not given.

The same format as start_time. start_time must be before end_time. There is no maximum time range.

The default is the time of the request.

event_type[]

array of strings

/

optional

Give only the events of these types. To give more than one type, repeat the parameter: event_type[]=delivery_attempt&event_type[]=bounce_all. Use the brackets: without them, only the last value is used.

The default is every type, but with an outmta_* or throttle_* filter the default is delivery_attempt. The types are: delivery_attempt, new_message, bounce_all, bounce_bad_address, bounce_lite, scomp, scomp_lite, engine_click, engine_open, engine_unsub, studio_click, studio_open, studio_unsub, studio_subscriber_created, studio_subscriber_updated and incoming_email.

Some filters can never match some event types, because those types do not store the field that the filter tests. See Filters and Event Types. If you give an event type and a filter that cannot match it, the API gives no events of that type.

recipient

string

/

optional

Give only the events of this recipient.

A value with an @ matches one email address exactly. Any other value matches every address at one domain exactly: example.com does not match mail.example.com. Case is ignored. An address is split at its last @, and it must have text before and after that @.

mailfrom_domain

string

/

optional

Give only the events whose RFC5321.MailFrom domain is this domain, exactly. Case is ignored. This must be a domain, not an email address.

outmta_id

integer

/

optional

Give only the events of the IP address or relay server with this ID. With no event_type[], the API gives delivery_attempt events only.

It also matches a deleted IP address or relay server.

outmta_name

string

/

optional

Give only the events of the IP addresses and relay servers with this name. With no event_type[], the API gives delivery_attempt events only. Case is ignored. It also matches a deleted IP address or relay server. It does not match routing rules.

You cannot give both outmta_id and outmta_name.

throttle_id

integer

/

optional

Give only the delivery attempts that used the throttle with this ID.

It also matches a deleted throttle.

throttle_domain

string

/

optional

Give only the delivery attempts that used a throttle whose domains include this domain. Case is ignored.

Each IP address has its own throttles, so a domain can match one throttle on each IP address. With outmta_id or outmta_name, it matches only the throttles of those IP addresses.

It matches only the throttles that exist now. To find the events of a deleted throttle, use throttle_id.

You cannot give both throttle_id and throttle_domain.

click_tracking_id

string

/

optional

Give only the events with this click tracking ID, which are the events of one message when each message has its own click tracking ID. It matches exactly: case matters. A blank value gives no filter.

per_page

integer

/

optional

The number of events on each page, from 1 to 500. The default is 100.

page_token

string

/

optional

The next_page_token of the previous page. Give it to get the next page.

Give the same filters with it as with the first page. The token holds the first page’s start_time, so that the time range does not move while you get the pages.

The pages are not a snapshot. GreenArrow can store an event some time after it occurs. An event stored while you get the pages shows on a later page only if it is older than the last event of the previous page. To be sure that you have every event of a time range, ask for the range again after GreenArrow has stored its events.

If outmta_name matches no IP address or relay server, or throttle_domain matches no throttle, the response has no events. This is not an error.

Examples:

GET /ga/api/v3/eng/events
GET /ga/api/v3/eng/[email protected]
GET /ga/api/v3/eng/events?recipient=example.com&event_type[]=delivery_attempt&event_type[]=bounce_all
GET /ga/api/v3/eng/events?start_time=2026-11-01T00:00:00&end_time=2026-11-02T00:00:00&outmta_name=ipaddr-1
GET /ga/api/v3/eng/events?throttle_domain=gmail.com&per_page=500

Response

events

array

The events of this page, newest first, as defined above.

per_page

integer

The number of events on each page.

next_page_token

string

The token that gets the next page. Give it as page_token.

null if this is the last page. The last page can have per_page events.

There is no count of the events that match.

Example

GET /ga/api/v3/eng/events?per_page=2&recipient=example.com

HTTP/1.1 200 OK

{
  "success": true,
  "data": {
    "events": [
      {
        "id": "01a1ab5d-9780-7000-8000-000000000003",
        "event_type": "engine_click",
        "event_time": "2026-11-05T06:00:00-05:00",
        "server_id": null,
        "email_localpart": "fred",
        "email_domain": "example.com",
        "sendid": null,
        "listid": null,
        "click_url": "https://sender.example/offer?id=12",
        "click_tracking_id": null,
        "engine_ip": "203.0.113.7",
        "user_agent": "Mozilla/5.0",
        "linkid": null,
        "mailclass": null,
        "instanceid": null,
        "email": "[email protected]",
        "summary": "click: https://sender.example/offer?id=12"
      },
      {
        "id": "01a1ab26-a900-7000-8000-000000000002",
        "event_type": "delivery_attempt",
        "event_time": "2026-11-05T05:00:00-05:00",
        "server_id": null,
        "email_localpart": "Jane",
        "email_domain": "example.com",
        "sendid": null,
        "listid": null,
        "bounce_code": null,
        "click_tracking_id": null,
        "timestamp": null,
        "channel": "remote",
        "status": "deferral",
        "is_retry": 1,
        "msguid": null,
        "sender": "[email protected]",
        "mtaid": null,
        "mtaid_id": null,
        "mtaid_name": null,
        "injected_time": null,
        "message": "198.51.100.25 does not like recipient./Remote host said: 452 4.2.2 Mailbox full",
        "outmtaid": 24,
        "outmtaid_name": "ipaddr-1",
        "outmtaid_ip": "192.0.2.10",
        "outmtaid_hostname": "mta1.sender.example",
        "sendsliceid": null,
        "throttleid": 42,
        "mx_hostname": "mx.example.com",
        "mx_ip": "198.51.100.25",
        "from_address": null,
        "headers": null,
        "message_size": null,
        "smtp_timing": null,
        "source_ip": null,
        "mailclass": null,
        "instanceid": null,
        "attempt_number": 2,
        "email": "[email protected]",
        "summary": "remote delivery deferral (retry): 198.51.100.25 does not like recipient./Remote host said: 452 4.2.2 Mailbox full",
        "throttle": {
          "id": 42,
          "name": "Throttle Rule for example.com, example.net, example.org…",
          "deleted": false
        }
      }
    ],
    "per_page": 2,
    "next_page_token": "gYxIWZ1ETO4YTN9BDM2MTO3MTO3EjOiUWbpR3X0JXY0NnIsIiMwADMwADMwADMwATLwADM40CMwAzNtADM5EWL2IjYhFTYxAjI6ICZpJye"
  },
  "error_code": null,
  "error_messages": null
}

Filters and Event Types

Some event types do not store the field that a filter tests, so the filter can never match them. With no event_type[], the outmta_* and throttle_* filters, which are about delivery, give delivery_attempt events only. With event_type[], the outmta_* filters also match the bounces and spam complaints that store the IP address or relay server:

Event type recipient mailfrom_domain outmta_* throttle_* click_tracking_id
new_message yes yes     yes
delivery_attempt yes yes yes yes yes
bounce_all yes yes yes   yes
bounce_bad_address yes       yes
bounce_lite   yes yes    
scomp yes   yes   yes
scomp_lite yes yes yes    
engine_click yes       yes
engine_open yes       yes
engine_unsub yes       yes
studio_click yes        
studio_open yes        
studio_unsub yes        
studio_subscriber_created yes        
studio_subscriber_updated yes        
incoming_email yes yes      

With no event_type[], a filter gives only the events of the types it can match.

A “yes” means that events of the type can store the field, not that every one does. For example, a bounce_all event stores the RFC5321.MailFrom and the IP address or relay server only for a message sent through SimpleMH while include_mtaid_info_at_delivery was on. Without them, mailfrom_domain and outmta_* do not find the event.

Event Summaries

The summary of an event depends on its type. It starts with a label, such as remote delivery failure (retry), and most labels are followed by free text, such as a message, a bounce text or a URL. The free text is put on one line. Free text longer than 200 characters is cut, and ends with …. The label is not cut, so a summary can be longer than 200 characters. When the event has no free text, the summary is the label alone, without the : , ` from ` or other words that come before the text. For example, an engine_unsub event with no URL has the summary unsubscribe, and a new_message event of a bounce message, whose RFC5321.MailFrom is empty, has the summary new message.

Event type Summary
delivery_attempt remote delivery deferral (retry): 452 4.2.2 Mailbox full. The channel (local or remote) and the status, and the message unless the delivery succeeded. failure_toolong is “failure (too long in the queue)”, and connmaxout is “deferral (not attempted)”. A retry adds “retry” in the parentheses, as in remote delivery failure (too long in the queue, retry).
bounce_all hard bounce (10: Bad e-mail address): 550 No such user. The bounce type, the bounce code and its description, and the bounce text.
bounce_bad_address bad address: and the summary of a bounce_all event.
bounce_lite bounce (10: Bad e-mail address): and the text that matched the bounce code.
scomp spam complaint
scomp_lite spam complaint on mail from and the RFC5321.MailFrom of the message that the complaint is about.
engine_click, studio_click click: and the URL.
engine_unsub unsubscribe: and the URL.
studio_unsub unsubscribe
engine_open, studio_open open, or privacy open.
new_message, incoming_email new message from or incoming email from , and the RFC5321.MailFrom.
studio_subscriber_created, studio_subscriber_updated subscriber created in list or subscriber updated in list , and the list’s name.

Errors

Each error has the HTTP status 200 OK, as in the other Engine API endpoints. Read error_code to tell the errors apart.

error_code When
not_authorized The credentials are not valid, or the user’s permission is stats-only or none.
feature_not_enabled Unified Statistics is not active, PostgreSQL is older than version 16, or the events table does not exist yet. The message gives the cause.
invalid_request A parameter is not valid. The message names the parameter.
query_timeout The request took longer than 30 seconds. Give a shorter time range, or change the filters.

Other errors that any Engine API call can give, such as database_exception and internal_error, can also occur.

For example:

{
  "success": false,
  "data": null,
  "error_code": "query_timeout",
  "error_messages": [
    "the events query ran longer than 30s; give a shorter time range, or change the filters"
  ]
}


Copyright © 2012–2026 GreenArrow Email