Download OpenAPI specification:
Kereru message sending and management API. Provides endpoints for querying and managing email and SMS message queues.
A scheduled Lambda invoked hourly via EventBridge (UTC) that sends queued messages.
Behaviour:
EventBridge event properties (all optional, with defaults):
| Property | Type | Default | Description |
|---|---|---|---|
| Cutoff | DateTime? | null | Explicit cutoff date. Takes precedence over MaxAgeMinutes. |
| MaxAgeMinutes | int | 1440 | Fallback age limit in minutes when Cutoff is not set. |
| Tenancy | string? | null | Restrict processing to a single tenancy. |
| IncludeEmail | bool | true | Whether to process queued emails. |
| IncludeSMS | bool | true | Whether to process queued SMS messages. |
| MaxAttempts | int | 5 | Maximum prior attempts for a packet to still be eligible. |
| MinPriority | int | 0 | Minimum priority (Low=0, Medium=1, High=2). |
Resends an existing email packet to SendGrid.
The packet is fetched from the queue by its ID and tenancy, then sent again via SendGrid directly. On success, the packet's queue status is set to ResentDirect (21), its delivery status is reset to Unknown (0), SentOn is updated, and the attempt counter is incremented.
Required Grants:
| packet required | string <uuid> The GUID of the email packet to resend. |
Sends one or more email packets immediately via SendGrid and records them in the email queue. Accepts a single object or an array of objects.
FromEmail falls back to the tenancy profile's FromEmail, then to the service default. If EmailServiceEnabled or AllowDirectSendEmail is false on the profile, packets are queued instead of sent.
Response is a single EmailPacket if one was provided, or an array of EmailPackets if multiple.
Required Grants:
| tenancy | string |
| id | string <uuid> |
| code | string Default: "" |
object (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
| subject | string |
| inReplyTo | string or null |
| htmlMessage | string |
| plainTextMessage | string |
| priority | integer Enum: 0 1 2 Priority levels: Low (0), Medium (1), High (2) |
| status | integer Enum: 0 1 10 11 20 21 30 31 Queue statuses: NotSent (0), Attempted (1), Sent (10), SentDirect (11), Resent (20), ResentDirect (21), Error (30), ErrorNoEmailCode (31) |
| deliveryStatus | integer Enum: 0 1 10 11 20 Delivery statuses: Unknown (0), Delivered (1), Bounced (10), Rejected (11), Opened (20). Updated via SendGrid webhook callbacks. |
| attempts | integer |
| errorMessage | string |
| batchID | string or null <uuid> |
| originID | string or null <uuid> |
| createdOn | string <date-time> |
| sentOn | string or null <date-time> |
| updatedOn | string <date-time> Last updated timestamp. Updated when delivery status changes. |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Queues one or more email packets for later sending and records them in the email queue. Accepts a single object or an array of objects.
FromEmail falls back to the tenancy profile's FromEmail, then to the service default.
Response is a single EmailPacket if one was provided, or an array of EmailPackets if multiple.
Required Grants:
| tenancy | string |
| id | string <uuid> |
| code | string Default: "" |
object (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
| subject | string |
| inReplyTo | string or null |
| htmlMessage | string |
| plainTextMessage | string |
| priority | integer Enum: 0 1 2 Priority levels: Low (0), Medium (1), High (2) |
| status | integer Enum: 0 1 10 11 20 21 30 31 Queue statuses: NotSent (0), Attempted (1), Sent (10), SentDirect (11), Resent (20), ResentDirect (21), Error (30), ErrorNoEmailCode (31) |
| deliveryStatus | integer Enum: 0 1 10 11 20 Delivery statuses: Unknown (0), Delivered (1), Bounced (10), Rejected (11), Opened (20). Updated via SendGrid webhook callbacks. |
| attempts | integer |
| errorMessage | string |
| batchID | string or null <uuid> |
| originID | string or null <uuid> |
| createdOn | string <date-time> |
| sentOn | string or null <date-time> |
| updatedOn | string <date-time> Last updated timestamp. Updated when delivery status changes. |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Queries the email queue with filtering, pagination, and ordering.
Tenancy is derived from request headers (PrimaryDomain + Application path parameter) and cannot be overridden in the request body.
All filter properties are optional. Send {} for defaults (page 0, 20 items, ordered by CreatedOn DESC, ID ASC).
Text filters (Subject, ErrorMessage, HtmlMessage, PlainTextMessage) use SQL LIKE — caller provides wildcards (e.g. %invoice% for contains). Address filters (FromEmail, ToEmail, CCEmail, BCCEmail, AnyEmail) also use LIKE via EXISTS subqueries. InReplyTo uses exact match.
Multiple address filters use AND semantics — all specified filters must independently match.
Required Grants:
| page | integer Default: 0 Zero-indexed page number. |
| pageSize | integer Default: 20 |
| orderBy | string or null Comma-separated column/direction pairs. Default: UpdatedOn DESC, ID ASC. |
| id | string or null <uuid> |
| subject | string or null LIKE filter. Caller provides wildcards. |
| inReplyTo | string or null Exact match on message ID reference. |
| status | integer or null |
| statusIn | Array of integers or null |
| priority | integer or null |
| priorityIn | Array of integers or null |
| attempts | integer or null |
| attemptsMin | integer or null |
| attemptsMax | integer or null |
| errorMessage | string or null LIKE filter. |
| htmlMessage | string or null LIKE filter. |
| plainTextMessage | string or null LIKE filter. |
| createdOnFrom | string or null <date-time> |
| createdOnTo | string or null <date-time> |
| sentOnFrom | string or null <date-time> |
| sentOnTo | string or null <date-time> |
| originID | string or null <uuid> |
| batchID | string or null <uuid> |
| deliveryStatus | integer or null Exact match. Delivery statuses: Unknown (0), Delivered (1), Bounced (10), Rejected (11), Opened (20). |
| deliveryStatusIn | Array of integers or null IN filter for delivery status values. |
| updatedOnFrom | string or null <date-time> |
| updatedOnTo | string or null <date-time> |
| fromEmail | string or null LIKE filter on From address. |
| toEmail | string or null LIKE filter on To addresses. |
| ccEmail | string or null LIKE filter on CC addresses. |
| bccEmail | string or null LIKE filter on BCC addresses. |
| anyEmail | string or null LIKE filter across all address types. |
{- "page": 0,
- "pageSize": 20,
- "orderBy": "UpdatedOn DESC, ID ASC",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "subject": "string",
- "inReplyTo": "string",
- "status": 0,
- "statusIn": [
- 0
], - "priority": 0,
- "priorityIn": [
- 0
], - "attempts": 0,
- "attemptsMin": 0,
- "attemptsMax": 0,
- "errorMessage": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "createdOnFrom": "2019-08-24T14:15:22Z",
- "createdOnTo": "2019-08-24T14:15:22Z",
- "sentOnFrom": "2019-08-24T14:15:22Z",
- "sentOnTo": "2019-08-24T14:15:22Z",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "deliveryStatus": 0,
- "deliveryStatusIn": [
- 0
], - "updatedOnFrom": "2019-08-24T14:15:22Z",
- "updatedOnTo": "2019-08-24T14:15:22Z",
- "fromEmail": "string",
- "toEmail": "string",
- "ccEmail": "string",
- "bccEmail": "string",
- "anyEmail": "string"
}{- "items": [
- {
- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}
], - "maxAvailableItems": 0
}Lists all email templates for the tenancy, ordered by Name ascending.
Required Grants:
[- {
- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "welcome-email",
- "name": "Welcome Email",
- "subject": "Welcome @@FirstName@@!",
- "plainTextMessage": "string",
- "htmlMessage": "string",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "createdOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}
]Creates a new email template.
Tenancy is set automatically from request headers. Code must be unique within the tenancy. Template messages support @@variable@@ tokens for variable replacement when sending.
Required Grants:
| tenancy | string |
| id | string <uuid> |
| code | string Unique template code within the tenancy. |
| name | string |
| subject | string Supports @@variable@@ token replacement. |
| plainTextMessage | string Supports @@variable@@ token replacement. |
| htmlMessage | string Supports @@variable@@ token replacement. |
| originID | string or null <uuid> |
| batchID | string or null <uuid> |
object (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
| createdOn | string <date-time> |
| updatedOn | string <date-time> |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "welcome-email",
- "name": "Welcome Email",
- "subject": "Welcome @@FirstName@@!",
- "plainTextMessage": "string",
- "htmlMessage": "string",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "createdOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "welcome-email",
- "name": "Welcome Email",
- "subject": "Welcome @@FirstName@@!",
- "plainTextMessage": "string",
- "htmlMessage": "string",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "createdOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Gets an email template by its code or ID.
Required Grants:
| code required | string The template code (string) or ID (GUID). |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "welcome-email",
- "name": "Welcome Email",
- "subject": "Welcome @@FirstName@@!",
- "plainTextMessage": "string",
- "htmlMessage": "string",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "createdOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Updates an existing email template by code or ID.
The template ID is preserved from the existing record.
Required Grants:
| code required | string The template code (string) or ID (GUID). |
| tenancy | string |
| id | string <uuid> |
| code | string Unique template code within the tenancy. |
| name | string |
| subject | string Supports @@variable@@ token replacement. |
| plainTextMessage | string Supports @@variable@@ token replacement. |
| htmlMessage | string Supports @@variable@@ token replacement. |
| originID | string or null <uuid> |
| batchID | string or null <uuid> |
object (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
Array of objects (Email Address) | |
| createdOn | string <date-time> |
| updatedOn | string <date-time> |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "welcome-email",
- "name": "Welcome Email",
- "subject": "Welcome @@FirstName@@!",
- "plainTextMessage": "string",
- "htmlMessage": "string",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "createdOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "welcome-email",
- "name": "Welcome Email",
- "subject": "Welcome @@FirstName@@!",
- "plainTextMessage": "string",
- "htmlMessage": "string",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "createdOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Resolves a template, applies @@variable@@ replacement using the provided Variables dictionary, applies any override fields, sends the email immediately via SendGrid, and records the packet in the email queue.
The Subject override (if provided) also has variable replacement applied.
Response is the constructed EmailPacket after sending and recording.
Required Grants:
| code required | string The template code (string) or ID (GUID). |
| code required | string The code of the template to use. |
object Variables for @@Key@@ token replacement in template fields. | |
object (Email Address) Overrides the template FromEmail when specified. | |
Array of objects or null (Email Address) Overrides the template ToEmail when specified. | |
Array of objects or null (Email Address) Overrides the template CCEmail when specified. | |
Array of objects or null (Email Address) Overrides the template BCCEmail when specified. | |
| subject | string or null Overrides the template Subject when specified. Also has variable replacement applied. |
| inReplyTo | string or null Overrides the packet InReplyTo when specified. |
| priority | integer or null Overrides the packet Priority when specified. |
| originID | string or null <uuid> Overrides the template OriginID when specified. |
| batchID | string or null <uuid> Overrides the template BatchID when specified. |
{- "code": "welcome-email",
- "variables": {
- "FirstName": "John",
- "CompanyName": "Acme Corp"
}, - "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "string",
- "inReplyTo": "string",
- "priority": 0,
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Resolves a template, applies @@variable@@ replacement using the provided Variables dictionary, applies any override fields, queues the email for later sending, and records the packet in the email queue.
The Subject override (if provided) also has variable replacement applied.
Response is the constructed EmailPacket after queuing and recording.
Required Grants:
| code required | string The template code (string) or ID (GUID). |
| code required | string The code of the template to use. |
object Variables for @@Key@@ token replacement in template fields. | |
object (Email Address) Overrides the template FromEmail when specified. | |
Array of objects or null (Email Address) Overrides the template ToEmail when specified. | |
Array of objects or null (Email Address) Overrides the template CCEmail when specified. | |
Array of objects or null (Email Address) Overrides the template BCCEmail when specified. | |
| subject | string or null Overrides the template Subject when specified. Also has variable replacement applied. |
| inReplyTo | string or null Overrides the packet InReplyTo when specified. |
| priority | integer or null Overrides the packet Priority when specified. |
| originID | string or null <uuid> Overrides the template OriginID when specified. |
| batchID | string or null <uuid> Overrides the template BatchID when specified. |
{- "code": "welcome-email",
- "variables": {
- "FirstName": "John",
- "CompanyName": "Acme Corp"
}, - "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "string",
- "inReplyTo": "string",
- "priority": 0,
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "code": "",
- "fromEmail": {
- "email": "user@example.com",
- "name": "John Smith"
}, - "toEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "ccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "bccEmail": [
- {
- "email": "user@example.com",
- "name": "John Smith"
}
], - "subject": "Welcome to Acme",
- "inReplyTo": "string",
- "htmlMessage": "string",
- "plainTextMessage": "string",
- "priority": 0,
- "status": 0,
- "deliveryStatus": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z",
- "updatedOn": "2019-08-24T14:15:22Z"
}Queries the SMS queue with filtering, pagination, and ordering.
Tenancy is derived from request headers (PrimaryDomain + Application path parameter) and cannot be overridden in the request body.
All filter properties are optional. Send {} for defaults (page 0, 20 items, ordered by CreatedOn DESC, ID ASC).
Text filters (Reference, Message, ErrorMessage) use SQL LIKE — caller provides wildcards (e.g. %keyword% for contains). RecipientNumber filter uses LIKE via an EXISTS subquery.
Required Grants:
| page | integer Default: 0 Zero-indexed page number. |
| pageSize | integer Default: 20 |
| orderBy | string or null Comma-separated column/direction pairs. Default: CreatedOn DESC, ID ASC. |
| id | string or null <uuid> |
| reference | string or null LIKE filter. Caller provides wildcards. |
| message | string or null LIKE filter. Caller provides wildcards. |
| status | integer or null |
| statusIn | Array of integers or null |
| priority | integer or null |
| priorityIn | Array of integers or null |
| attempts | integer or null |
| attemptsMin | integer or null |
| attemptsMax | integer or null |
| errorMessage | string or null LIKE filter. |
| createdOnFrom | string or null <date-time> |
| createdOnTo | string or null <date-time> |
| sentOnFrom | string or null <date-time> |
| sentOnTo | string or null <date-time> |
| originID | string or null <uuid> |
| batchID | string or null <uuid> |
| recipientNumber | string or null LIKE filter on recipient numbers. |
{- "page": 0,
- "pageSize": 20,
- "orderBy": "CreatedOn DESC, ID ASC",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "reference": "string",
- "message": "string",
- "status": 0,
- "statusIn": [
- 0
], - "priority": 0,
- "priorityIn": [
- 0
], - "attempts": 0,
- "attemptsMin": 0,
- "attemptsMax": 0,
- "errorMessage": "string",
- "createdOnFrom": "2019-08-24T14:15:22Z",
- "createdOnTo": "2019-08-24T14:15:22Z",
- "sentOnFrom": "2019-08-24T14:15:22Z",
- "sentOnTo": "2019-08-24T14:15:22Z",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "recipientNumber": "string"
}{- "items": [
- {
- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "reference": "string",
- "toSMS": [
- "+6421000000"
], - "message": "string",
- "priority": 0,
- "status": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z"
}
], - "maxAvailableItems": 0
}Sends one or more SMS packets immediately via TNZ and records them in the SMS queue. Accepts a single object or an array of objects.
If SMSServiceEnabled or AllowDirectSendSMS is false on the profile, packets are queued instead of sent.
Response is a single SMSPacket if one was provided, or an array of SMSPackets if multiple.
Required Grants:
| tenancy | string |
| id | string <uuid> |
| reference | string or null |
| toSMS | Array of strings |
| message | string |
| priority | integer Enum: 0 1 2 Priority levels: Low (0), Medium (1), High (2) |
| status | integer Enum: 0 1 10 11 20 21 30 31 Queue statuses: NotSent (0), Attempted (1), Sent (10), SentDirect (11), Resent (20), ResentDirect (21), Error (30), ErrorNoEmailCode (31) |
| attempts | integer |
| errorMessage | string |
| batchID | string or null <uuid> |
| originID | string or null <uuid> |
| createdOn | string <date-time> |
| sentOn | string or null <date-time> |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "reference": "string",
- "toSMS": [
- "+6421000000"
], - "message": "string",
- "priority": 0,
- "status": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "reference": "string",
- "toSMS": [
- "+6421000000"
], - "message": "string",
- "priority": 0,
- "status": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z"
}Queues one or more SMS packets for later sending and records them in the SMS queue. Accepts a single object or an array of objects.
Response is a single SMSPacket if one was provided, or an array of SMSPackets if multiple.
Required Grants:
| tenancy | string |
| id | string <uuid> |
| reference | string or null |
| toSMS | Array of strings |
| message | string |
| priority | integer Enum: 0 1 2 Priority levels: Low (0), Medium (1), High (2) |
| status | integer Enum: 0 1 10 11 20 21 30 31 Queue statuses: NotSent (0), Attempted (1), Sent (10), SentDirect (11), Resent (20), ResentDirect (21), Error (30), ErrorNoEmailCode (31) |
| attempts | integer |
| errorMessage | string |
| batchID | string or null <uuid> |
| originID | string or null <uuid> |
| createdOn | string <date-time> |
| sentOn | string or null <date-time> |
{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "reference": "string",
- "toSMS": [
- "+6421000000"
], - "message": "string",
- "priority": 0,
- "status": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z"
}{- "tenancy": "acme.org.nz.core",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "reference": "string",
- "toSMS": [
- "+6421000000"
], - "message": "string",
- "priority": 0,
- "status": 0,
- "attempts": 0,
- "errorMessage": "string",
- "batchID": "56707290-2f9b-4967-9c9d-1b759fac6d42",
- "originID": "aad7996f-780d-4b0a-9fb2-c7b70efff27f",
- "createdOn": "2019-08-24T14:15:22Z",
- "sentOn": "2019-08-24T14:15:22Z"
}Receives delivery status updates from SendGrid's Event Webhook.
This endpoint is called by SendGrid, not by application clients. It does not require an API key but uses a dedicated callback authorizer.
The request body is a JSON array of SendGrid event objects. Each event is processed independently:
SendGrid event type to DeliveryStatus mapping:
| SendGrid Event | DeliveryStatus |
|---|---|
| delivered | Delivered (1) |
| bounce | Bounced (10) |
| blocked, dropped, spamreport | Rejected (11) |
| open, click | Opened (20) |
| event | string Enum: "delivered" "open" "click" "bounce" "blocked" "dropped" "spamreport" "deferred" "processed" SendGrid event type. Mapped to DeliveryStatus: delivered → Delivered (1), open/click → Opened (2), bounce → Bounced (10), blocked/dropped/spamreport → Rejected (11). Other event types are ignored. |
| KereruID | string <uuid> The Kereru email packet ID. Events without a valid KereruID are skipped. |
[- {
- "event": "delivered",
- "KereruID": "550e8400-e29b-41d4-a716-446655440000"
}, - {
- "event": "open",
- "KereruID": "550e8400-e29b-41d4-a716-446655440000"
}
]