Skip to main content
Versionv1

Email Gateway API (1.0)

Download OpenAPI specification:Download

Send transactional and marketing emails, manage domains, suppressions, webhooks, and more.

Send Email

Send marketing email

Sends a marketing email, such as a newsletter or promotion. An unsubscribe link and a one-click unsubscribe header are added automatically. Set scheduledAt to deliver the email later, up to 72 hours ahead. The response contains a messageId; delivery results are available through webhooks and in the email logs.

Authorizations:
ProductToken
header Parameters
X-CM-PRODUCTTOKEN
string

Your CM.com product token, which authenticates the request. Find it in the Email Gateway App → Settings → Integration.

Sandbox-Mode
boolean
Default: false

Set to true to validate the request without sending the email. In sandbox mode the email is checked (required fields, size, attachments and format) but not delivered. It does not count towards your usage and is not logged. Defaults to false.

Request Body schema:

The marketing email to send.

object

Sender of the email. The address must be on a domain that is verified for your account, and a display name is required.

object

Address that replies are sent to. When omitted, replies go to the sender.

Array of objects or null (Gateway_EmailAddress)

Primary recipients of the email. The total number of recipients across to, cc and bcc is limited to 50.

Array of objects or null (Gateway_EmailAddress)

Recipients that receive a visible copy of the email. Counts towards the limit of 50 recipients in total.

Array of objects or null (Gateway_EmailAddress)

Recipients that receive a hidden copy of the email. Other recipients cannot see these addresses. Counts towards the limit of 50 recipients in total.

subject
required
string or null

Subject line of the email.

html
string or null

HTML body of the email. Provide html, text or both. To show an inline attachment, reference its contentId with a cid: URL. An image written as <img src='data:image/...;base64,...'> (single quotes) is converted to an inline attachment and checked like any other attachment; invalid base64 is rejected, and if the HTML body cannot be processed in time the request is rejected with "The HTML body could not be processed."

text
string or null

Plain-text body of the email. Provide text, html or both. Email clients that cannot display HTML show this version.

Array of objects or null (Gateway_EmailAttachment)

Files to attach to the email. The content of each file is Base64 encoded, and the total size of the email including all attachments is limited. Any file type is accepted. Executable files are blocked, which means Windows (.exe, .dll) and Linux executable programs are rejected, whatever name or content type they are given.

customerReference
string or null

Your own reference for this email, for example an order or user ID. It is included in the webhook events for the email.

scheduledAt
string or null

Date and time to deliver the email, in ISO 8601 format with a UTC offset, for example 2026-06-10T15:30:00+02:00. Emails can be scheduled up to 72 hours ahead. When omitted, the email is sent immediately.

inReplyTo
string or null

Message-ID of the email you are replying to, including the angle brackets, for example <20260617052825.68047ebb-f07f-48bb-a504-f4dc42d073c1@yourdomain.com>. Email clients use it to show the email in the same conversation.

references
string or null

Message-IDs of the earlier emails in the conversation, separated by spaces and ordered from oldest to newest. Use together with inReplyTo to thread the email in the recipient's email client.

object or null

Custom email headers as flat key-value pairs, for example {"X-Campaign-ID": "promo-2026"}. Maximum 20 headers. Names can only contain letters, digits and hyphens, and must start and end with a letter or digit. Values must be printable ASCII, at most 998 characters. Reserved system headers such as From, To, Subject, Message-ID and DKIM-Signature cannot be overridden. Invalid headers are rejected with a 400 error.

Responses

Request samples

Content type
{
  • "from": {
    },
  • "replyTo": {
    },
  • "to": [
    ],
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "string",
  • "html": "string",
  • "text": "string",
  • "attachments": [
    ],
  • "customerReference": "string",
  • "scheduledAt": "string",
  • "inReplyTo": "string",
  • "references": "string",
  • "headers": {
    }
}

Response samples

Content type
application/json
{
  • "status": 0,
  • "message": "string",
  • "success": true,
  • "messageId": "string",
  • "batchId": "string"
}

Send transactional email

Sends a transactional email, such as a password reset, order confirmation or one-time code. Use the priority query parameter to mark time-sensitive emails as high. Set scheduledAt to deliver the email later, up to 72 hours ahead. The response contains a messageId; delivery results are available through webhooks and in the email logs.

Authorizations:
ProductToken
query Parameters
priority
required
string

Delivery priority of the transactional email. Use high for time-sensitive emails such as password resets and one-time codes, and low for standard emails such as order confirmations and receipts.

header Parameters
X-CM-PRODUCTTOKEN
string

Your CM.com product token, which authenticates the request. Find it in the Email Gateway App → Settings → Integration.

Sandbox-Mode
boolean
Default: false

Set to true to validate the request without sending the email. In sandbox mode the email is checked (required fields, size, attachments and format) but not delivered. It does not count towards your usage and is not logged. Defaults to false.

Request Body schema:

The transactional email to send.

object

Sender of the email. The address must be on a domain that is verified for your account, and a display name is required.

object

Address that replies are sent to. When omitted, replies go to the sender.

Array of objects or null (Gateway_EmailAddress)

Primary recipients of the email. The total number of recipients across to, cc and bcc is limited to 50.

Array of objects or null (Gateway_EmailAddress)

Recipients that receive a visible copy of the email. Counts towards the limit of 50 recipients in total.

Array of objects or null (Gateway_EmailAddress)

Recipients that receive a hidden copy of the email. Other recipients cannot see these addresses. Counts towards the limit of 50 recipients in total.

subject
required
string or null

Subject line of the email.

html
string or null

HTML body of the email. Provide html, text or both. To show an inline attachment, reference its contentId with a cid: URL. An image written as <img src='data:image/...;base64,...'> (single quotes) is converted to an inline attachment and checked like any other attachment; invalid base64 is rejected, and if the HTML body cannot be processed in time the request is rejected with "The HTML body could not be processed."

text
string or null

Plain-text body of the email. Provide text, html or both. Email clients that cannot display HTML show this version.

Array of objects or null (Gateway_EmailAttachment)

Files to attach to the email. The content of each file is Base64 encoded, and the total size of the email including all attachments is limited. Any file type is accepted. Executable files are blocked, which means Windows (.exe, .dll) and Linux executable programs are rejected, whatever name or content type they are given.

customerReference
string or null

Your own reference for this email, for example an order or user ID. It is included in the webhook events for the email.

scheduledAt
string or null

Date and time to deliver the email, in ISO 8601 format with a UTC offset, for example 2026-06-10T15:30:00+02:00. Emails can be scheduled up to 72 hours ahead. When omitted, the email is sent immediately.

inReplyTo
string or null

Message-ID of the email you are replying to, including the angle brackets, for example <20260617052825.68047ebb-f07f-48bb-a504-f4dc42d073c1@yourdomain.com>. Email clients use it to show the email in the same conversation.

references
string or null

Message-IDs of the earlier emails in the conversation, separated by spaces and ordered from oldest to newest. Use together with inReplyTo to thread the email in the recipient's email client.

object or null

Custom email headers as flat key-value pairs, for example {"X-Campaign-ID": "promo-2026"}. Maximum 20 headers. Names can only contain letters, digits and hyphens, and must start and end with a letter or digit. Values must be printable ASCII, at most 998 characters. Reserved system headers such as From, To, Subject, Message-ID and DKIM-Signature cannot be overridden. Invalid headers are rejected with a 400 error.

Responses

Request samples

Content type
{
  • "from": {
    },
  • "replyTo": {
    },
  • "to": [
    ],
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "string",
  • "html": "string",
  • "text": "string",
  • "attachments": [
    ],
  • "customerReference": "string",
  • "scheduledAt": "string",
  • "inReplyTo": "string",
  • "references": "string",
  • "headers": {
    }
}

Response samples

Content type
application/json
{
  • "status": 0,
  • "message": "string",
  • "success": true,
  • "messageId": "string",
  • "batchId": "string"
}

Domains

Add domain

Registers a domain for sending. DNS records are generated for the domain; add them to your DNS provider and then verify the domain. Use the get domain endpoint to retrieve the records.

Authorizations:
ProductToken
Request Body schema:

The domain to register.

accountId
string <uuid>

Identifier (UUID) of the logical account to add the domain to.

domain
string or null

Domain name to add, for example example.com. Subdomains such as promo.example.com are supported.

clickTracking
boolean

Set to true to track link clicks for emails sent from this domain.

openTracking
boolean

Set to true to track opens for emails sent from this domain.

Responses

Request samples

Content type
{
  • "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9",
  • "domain": "string",
  • "clickTracking": true,
  • "openTracking": true
}

Response samples

Content type
application/json
{
  • "domainConfig": {
    },
  • "status": 200,
  • "message": "string",
  • "success": true
}

List account domains

Returns all domains registered for an account, including their DNS records, verification status and tracking settings.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

Responses

Response samples

Content type
application/json
{
  • "domains": [
    ],
  • "status": 200,
  • "message": "string",
  • "success": true
}

Get domain

Returns the DNS records you must configure for a domain, and whether each record is currently valid.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

domainId
required
string <uuid>

Identifier (UUID) of the domain, as returned in the id field of the domain.

Responses

Response samples

Content type
application/json
{
  • "dnsRecords": [
    ],
  • "status": 200,
  • "message": "string",
  • "success": true
}

Delete domain

Removes a domain and all of its DNS records from the account.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

domainId
required
string <uuid>

Identifier (UUID) of the domain, as returned in the id field of the domain.

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "message": "string",
  • "success": true
}

Enable or disable sending

Enables or disables sending for a domain. The response contains the domain configuration after the change.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

domain
required
string

Domain name to change the setting for, for example example.com.

query Parameters
enabled
required
boolean

Set to true to enable sending for the domain, or false to disable it.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "status": 200,
  • "message": "string",
  • "data": [
    ]
}

Enable or disable receiving

Enables or disables receiving for a domain. Receiving requires the MX record of the domain to be verified. The response contains the domain configuration after the change.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

domain
required
string

Domain name to change the setting for, for example example.com.

query Parameters
enabled
required
boolean

Set to true to enable receiving for the domain, or false to disable it.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "status": 200,
  • "message": "string",
  • "data": [
    ]
}

Verify DNS records

Checks the DNS records of a domain against the records that were generated for it and reports whether each record is valid. A domain is ready to send once all of its records are valid. DNS changes can take from a few minutes up to 48 hours to propagate, so run the verification again if records are still reported as invalid.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
domain
string

Domain name to verify, for example example.com.

Responses

Response samples

Content type
No sample

Verify DNS capability

Checks the DNS records of a domain for one capability only: sending (the CNAME records), receiving (the MX record) or all. A record is valid when it is found in DNS with the expected value.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

capability
required
string
Enum: "sending" "receiving" "all"

Which DNS records to verify: sending (the CNAME records used for sending), receiving (the MX record used for receiving) or all.

query Parameters
domain
string

Domain name to verify, for example example.com.

Responses

Response samples

Content type
No sample

Receive Emails

List received emails

Returns a page of the emails received on your receiving domains. Filter by time range, direction or search text.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
LogTimeRangeType
integer <int32> (Configuration_TimeRangePickerOptions)
Enum: 1 2 3 4 5 6 7 8 9

Predefined time range to filter received emails by. Use the custom range option together with StartDate and EndDate.

Direction
string

Filter by direction.

SearchText
string

Free-text search.

StartDate
string <date-time>

Required with EndDate when LogTimeRangeType is a custom range.

EndDate
string <date-time>

End of the time range. Required with StartDate when LogTimeRangeType is a custom range.

timezone
string
Default: "UTC"

IANA time zone used to render timestamps.

pageNumber
integer <int32>
Default: 1

Page number to return, starting at 1.

itemsPerPage
integer <int32>
Default: 10

Number of emails to return per page.

Responses

Response samples

Content type
application/json
{
  • "statusCode": 200,
  • "message": "string",
  • "totalCount": 0,
  • "emails": [
    ]
}

Get received email

Returns the details of one received email, including its headers, body and attachment metadata.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

emailId
required
string <uuid>

Unique identifier (UUID) of the received email.

query Parameters
timezone
string
Default: "UTC"

IANA time zone used to render timestamps.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "status": 200,
  • "message": "string",
  • "data": {
    }
}

List received email attachments

Returns the attachments of a received email, including a download URL for each attachment.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

emailId
required
string <uuid>

Unique identifier (UUID) of the received email.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "status": 200,
  • "message": "string",
  • "data": [
    ]
}

Receive Webhooks

List receiving webhooks

Returns the receiving webhooks of an account. A receiving webhook is called for each email received on a domain.

Authorizations:
ProductToken
path Parameters
logicalAccount
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
domain
string

Only return the receiving webhooks for this recipient domain.

Responses

Response samples

Content type
application/json
{
  • "webhookResponse": [
    ],
  • "status": 200,
  • "message": "string",
  • "success": true
}

Create receiving webhook

Creates a receiving webhook that is called for each email received on a domain. The webhook URL must be an HTTPS URL on port 443.

Authorizations:
ProductToken
path Parameters
logicalAccount
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

Request Body schema:

The receiving webhook to create.

webhookUrl
string or null

HTTPS URL, port 443. Trailing slash is removed.

domain
string or null

Recipient domain. Stored lower-case.

usePresignedAttachments
boolean or null

Send attachments as download links instead of inline base64. Default false.

presignedUrlExpiryHours
integer or null <int32>

Lifetime of download links in hours. Default 24, effective maximum 168.

Responses

Request samples

Content type
{
  • "webhookUrl": "string",
  • "domain": "string",
  • "usePresignedAttachments": true,
  • "presignedUrlExpiryHours": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "status": 200,
  • "message": "string",
  • "data": {
    }
}

Update receiving webhook

Updates a receiving webhook. Only the fields you provide are changed.

Authorizations:
ProductToken
path Parameters
logicalAccount
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

Request Body schema:

The receiving webhook fields to change.

id
string <uuid>

Identifier (UUID) of the receiving webhook to update. Must not be an empty UUID.

resetPresignedUrlExpiryHours
boolean

Sets the expiry back to 24. Wins over presignedUrlExpiryHours.

webhookUrl
string or null

New webhook URL. HTTPS URL, port 443. Trailing slash is removed. Leave out to keep the current URL.

domain
string or null

New recipient domain. Stored lower-case. Leave out to keep the current domain.

usePresignedAttachments
boolean or null

Send attachments as download links instead of inline base64. Default false.

presignedUrlExpiryHours
integer or null <int32>

Lifetime of download links in hours. Default 24, effective maximum 168.

Responses

Request samples

Content type
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "resetPresignedUrlExpiryHours": true,
  • "webhookUrl": "string",
  • "domain": "string",
  • "usePresignedAttachments": true,
  • "presignedUrlExpiryHours": 0
}

Response samples

Content type
application/json
{
  • "webhookResponse": [
    ],
  • "status": 200,
  • "message": "string",
  • "success": true
}

Delete receiving webhook

Deletes a receiving webhook. The response contains the number of deleted rows.

Authorizations:
ProductToken
path Parameters
logicalAccount
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

id
required
string <uuid>

Identifier (UUID) of the receiving webhook to delete.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "status": 200,
  • "message": "string",
  • "data": 0
}

Webhooks

Create webhook

Registers a webhook URL for an email event type, such as delivered or bounced. Use the type global to receive all events on one URL. Registering a type that already has a webhook replaces its URL. The response contains the ID of the webhook.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

Request Body schema:

The event type and the URL to register.

webhookType
string or null

Event type the webhook receives: global (all events), delivered, opened, clicked, bounced, unsubscribed, complained, failed, sent or suppressed. Registering a type that already has a webhook replaces its URL.

webhookUrl
string or null

HTTPS URL that receives the event notifications. It must be publicly reachable and should respond with a 200 status.

Responses

Request samples

Content type
{
  • "webhookType": "string",
  • "webhookUrl": "string"
}

Response samples

Content type
No sample

List webhooks

Returns the webhook configuration of an account.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
all
boolean
Default: false

Set to true to return all webhooks of the account. Defaults to false.

Responses

Response samples

Content type
No sample

Delete webhook

Deletes the webhook that is registered for an email event type.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
webhookType
string

Event type of the webhook to delete: global, delivered, opened, clicked, bounced, unsubscribed, complained, failed, sent or suppressed.

Responses

Response samples

Content type
No sample

Suppressions

Add manual suppression

Adds recipients to the suppression list, so that emails of the given type are no longer sent to them. A request can contain up to 10 entries.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

Request Body schema:

The recipients to add to the suppression list. Maximum 10 entries.

Array
sender
string or null <email>

Email address of the sender the suppression applies to.

recipient
required
string or null <email>

Email address of the recipient to suppress.

unsubscribeType
integer <int32>
Enum: 1 2 3 4 5 6 7

Why the recipient is suppressed: 1 hard bounce, 2 soft bounce, 3 requested by the system, 4 requested by an administrator, 5 unsubscribed through the link in the email, 6 unsubscribed through the email header (one-click unsubscribe), 7 manually unsubscribed.

emailType
integer <int32>
Enum: 0 1 2 -1

Type of email to suppress: 0 marketing, 1 high-priority transactional, 2 low-priority transactional.

Responses

Request samples

Content type
[]

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "status": 200,
  • "data": { }
}

Search unsubscribes

Searches the unsubscribe list with a set of filters in the request body. Results are paginated.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
timezone
string

IANA time zone used to render timestamps.

pageSize
integer <int32>
Default: 10

Number of results to return per page, from 1 to 100.

pageNumber
integer <int32>
Default: 1

Page number to return, starting at 1.

Request Body schema:

Filters to apply to the unsubscribe list.

logTimeRangeType
integer <int32>
Enum: 1 2 3 4 5 6 7 8 9

Predefined time range to filter by. Use the custom range option together with startDate and endDate.

unsubscribeTypes
string or null

Unsubscribe types to include in the results. See the unsubscribeType values of the suppression list.

startDate
string or null <date-time>

Start of the time range. Used together with endDate when logTimeRangeType is a custom range.

endDate
string or null <date-time>

End of the time range. Used together with startDate when logTimeRangeType is a custom range.

searchEmail
string or null

Return only records whose email address contains this text.

Responses

Request samples

Content type
{
  • "logTimeRangeType": 1,
  • "unsubscribeTypes": "string",
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-24T14:15:22Z",
  • "searchEmail": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "status": 200,
  • "data": {
    }
}

List suppressions

Returns the suppression list of an account. Filter by recipient email address and email type. Results are paginated, with up to 100 results per page.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

query Parameters
searchEmail
string

Return only suppressions whose recipient email address matches this text. Partial matches are supported.

emailType
integer <int32>
Default: -1

Filter by email type: -1 all types (default), 0 marketing, 1 high-priority transactional, 2 low-priority transactional.

pageSize
integer <int32>
Default: 10

Number of results to return per page, from 1 to 100.

pageNumber
integer <int32>
Default: 1

Page number to return, starting at 1.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "status": 200,
  • "data": {
    }
}

Remove suppressions in bulk

Removes several recipients from the suppression list in one request, so that emails of the given type can be sent to them again. Each entry identifies a suppression by sender, recipient and email type.

A suppression is removed only when sender, recipient and email type all match an existing suppression exactly. Entries that match nothing do not fail the request. The response lists them in data.failedRemovals, each with a reason. Check this list even when the response status is 200.

Authorizations:
ProductToken
path Parameters
logicalAccountId
required
string <uuid>

Identifier (UUID) of the logical account the request applies to.

Request Body schema:
required

The suppressions to remove. The list must contain at least one entry.

Array
sender
required
string <email>

Email address of the sender the suppression applies to. Must match the suppression exactly.

recipient
required
string <email>

Email address of the suppressed recipient. Must match the suppression exactly.

emailType
integer <int32>
Enum: 0 1 2 -1

Type of email the suppression applies to: 0 marketing (default), 1 high-priority transactional, 2 low-priority transactional.

Responses

Request samples

Content type
[]

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "status": 200,
  • "data": {
    }
}

Update suppression

Unsubscribes a recipient using the unique key from the unsubscribe link in an email. You can optionally provide the reason the recipient gives for unsubscribing.

Authorizations:
ProductToken
path Parameters
uniqueKey
required
string <uuid>

Unique key (UUID) from the unsubscribe link in the email.

Request Body schema:

The reason the recipient gives for unsubscribing.

unsubscribeReason
string or null

Reason the recipient gives for unsubscribing. Optional.

Responses

Request samples

Content type
{
  • "unsubscribeReason": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "status": 200,
  • "data": { }
}