GreenArrow Email Software Documentation

Incoming Email Messages API

Overview

When a message is delivered to an incoming email mailbox configured with the event delivery type, GreenArrow stores the message text in S3 and generates an incoming_email event. That event includes a message_text_identifier, which is used with this API to retrieve or delete the stored message text.

This API requires the s3 incoming_email_event purpose to be configured. If it is not, these endpoints return a 503 response with an s3_not_configured error code.

Permissions

This API uses the same HTTP basic authentication as the rest of the GreenArrow Engine Configuration API, but the two endpoints require different levels of access:

  • Retrieving a message text requires a user whose API permission is anything other than no.

  • Deleting a message text requires a user whose API permission is yes. A read-only or stats-only user receives a 403 response with a forbidden error code.

Retrieve the message text for an incoming email event

GET /ga/api/v3/eng/incoming_email_messages/{message_text_identifier}

Returns the full text of the message that was received, including its headers.

The {message_text_identifier} is the value of the same-named field on the incoming_email event.

Response

message_text

string

The full text of the received message, including headers.

Example

GET /ga/api/v3/eng/incoming_email_messages/0198d5c2-7f3a-7000-8000-1f2e3d4c5b6a

HTTP/1.1 200 OK

{
  "success": true,
  "data": {
    "message_text": "Return-Path: <[email protected]>\r\nTo: [email protected]\r\nSubject: Hello\r\n\r\nMessage body\r\n"
  },
  "error_code": null,
  "error_messages": null
}

Delete the message text for an incoming email event

DELETE /ga/api/v3/eng/incoming_email_messages/{message_text_identifier}

Deletes the stored message text from S3. The incoming_email event itself is not affected; only the stored message text is removed.

Example

DELETE /ga/api/v3/eng/incoming_email_messages/0198d5c2-7f3a-7000-8000-1f2e3d4c5b6a

HTTP/1.1 200 OK

{
  "success": true,
  "data": null,
  "error_code": null,
  "error_messages": null
}

Error Codes

Both endpoints can return the following errors, in addition to the standard API error responses.

bad_request

400

The supplied identifier does not look like a valid message text identifier.

unauthorized

401

No credentials were supplied, or the credentials were not valid.

forbidden

403

The authenticated user does not have sufficient API permission for this endpoint. See Permissions.

not_found

404

No stored message text was found for the supplied identifier. This is also returned when the message text has already been deleted.

s3_not_configured

503

The s3 incoming_email_event purpose has not been configured.

s3_error

502

An error occurred while communicating with S3.


Copyright © 2012–2026 GreenArrow Email