Email Gateway API Documentation
Email Gateway endpoints for managing transactional email sending through verified domains, including domain management, API keys, SMTP credentials, webhooks, and email delivery.
Add a Sender Domain
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.AddDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.adddomain |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainName | String | Yes | Domain name to add (e.g., example.com) |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.adddomain",
"SessionID": "your-session-id",
"DomainName": "example.com"
}'{
"Success": true,
"ErrorCode": 0,
"NewSenderDomainID": 123,
"Domain": {
"DomainID": 123,
"SenderDomain": "example.com",
"Status": "Approval Pending",
"Options": {}
}
}{
"Success": false,
"ErrorCode": [1]
}0: Success
1: Missing required parameter (DomainName)
2: Invalid domain name format
3: Maximum sender domains limit reached for userGet Sender Domain Details
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.getdomain |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.getdomain",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"Domain": {
"DomainID": 123,
"SenderDomain": "example.com",
"Status": "Enabled",
"Options": {
"LinkTracking": 1,
"OpenTracking": 1,
"UnsubscribeLink": 0
}
}
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedUpdate Sender Domain Settings
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.updatedomain |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
| LinkTracking | Integer | No | Enable link tracking (1 = enabled, 0 = disabled) |
| OpenTracking | Integer | No | Enable open tracking (1 = enabled, 0 = disabled) |
| UnsubscribeLink | Integer | No | Enable unsubscribe link (1 = enabled, 0 = disabled) |
| HostingProvider | String | No | Hosting provider name |
| Subdomain | String | No | Custom subdomain for tracking |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.updatedomain",
"SessionID": "your-session-id",
"DomainID": 123,
"LinkTracking": 1,
"OpenTracking": 1
}'{
"Success": true,
"ErrorCode": 0,
"Domain": {
"DomainID": 123,
"SenderDomain": "example.com",
"Status": "Enabled",
"Options": {
"LinkTracking": 1,
"OpenTracking": 1
}
}
}{
"Success": false,
"ErrorCode": 5
}0: Success
1: Missing required parameter (DomainID)
5: Domain not found or access deniedVerify Sender Domain DNS Records
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.verifydomain |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.verifydomain",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"Domain": {
"DomainID": 123,
"SenderDomain": "example.com",
"Status": "Enabled"
},
"DNSVerificationResults": {
"mail.example.com": ["CNAME", "target.example.com", true],
"example.com": ["TXT", "v=spf1 include:example.com ~all", true]
}
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedGet All Sender Domains
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.getdomains |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.getdomains",
"SessionID": "your-session-id"
}'{
"Success": true,
"ErrorCode": 0,
"Domains": [
{
"DomainID": 123,
"SenderDomain": "example.com",
"Status": "Enabled"
},
{
"DomainID": 124,
"SenderDomain": "another.com",
"Status": "Approval Pending"
}
]
}{
"Success": false,
"ErrorCode": []
}0: SuccessDelete a Sender Domain
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.deletedomain |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID to delete |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.deletedomain",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedClear Domain Email Queue
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.cleardomainqueue |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.cleardomainqueue",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedGet Domain Statistics
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.domainstats |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
| StartDate | String | No | Start date (Y-m-d format, default: 28 days ago) |
| EndDate | String | No | End date (Y-m-d format, default: today) |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.domainstats",
"SessionID": "your-session-id",
"DomainID": 123,
"StartDate": "2024-01-01",
"EndDate": "2024-01-31"
}'{
"Success": true,
"ErrorCode": 0,
"Stats": {
"Sent": 1000,
"Delivered": 950,
"Bounced": 50,
"Opened": 400,
"Clicked": 150
},
"ComparisonStats": {
"PreviousPeriod": {
"Sent": 800,
"Delivered": 760
}
},
"TagStats": {
"campaign1": {
"Sent": 500,
"Delivered": 475
}
}
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedCreate API Key for Domain
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.addapi |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| Description | String | Yes | Description for the API key |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.addapi",
"SessionID": "your-session-id",
"Description": "Production API Key",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"NewAPIKeyID": 456,
"APIKey": {
"APIKeyID": 456,
"APIKey": "eg_live_xxxxxxxxxxxx",
"Description": "Production API Key",
"DomainID": 123
}
}{
"Success": false,
"ErrorCode": [1, 2]
}0: Success
1: Missing required parameter (Description)
2: Missing required parameter (DomainID)
3: Domain not found or access deniedGet Domain API Keys
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.getapis |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.getapis",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"APIKeys": [
{
"APIKeyID": 456,
"APIKey": "eg_live_xxxxxxxxxxxx",
"Description": "Production API Key",
"DomainID": 123
}
]
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedDelete Domain API Key
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.deleteapi |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| APIKeyID | Integer | Yes | API Key ID to delete |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.deleteapi",
"SessionID": "your-session-id",
"APIKeyID": 456
}'{
"Success": true,
"ErrorCode": 0
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (APIKeyID)
2: API Key not found or access deniedCreate SMTP Credentials for Domain
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.addsmtp |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.addsmtp",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"NewSMTPID": 789,
"SMTP": {
"SMTPID": 789,
"SMTPUsername": "smtp_user_xxx",
"SMTPPassword": "generated_password",
"SMTPHost": "smtp.example.com",
"SMTPPorts": [25, 587, 2525]
}
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedGet Domain SMTP Credentials
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.getsmtps |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.getsmtps",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"SMTPs": [
{
"SMTPID": 789,
"SMTPUsername": "smtp_user_xxx",
"SMTPHost": "smtp.example.com",
"SMTPPorts": [25, 587, 2525]
}
]
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedDelete SMTP Credentials
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.deletesmtp |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| SMTPID | Integer | Yes | SMTP credentials ID to delete |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.deletesmtp",
"SessionID": "your-session-id",
"SMTPID": 789
}'{
"Success": true,
"ErrorCode": 0
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (SMTPID)
2: SMTP credentials not found or access deniedReset SMTP Password
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.resetsmtppassword |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| SMTPID | Integer | Yes | SMTP credentials ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.resetsmtppassword",
"SessionID": "your-session-id",
"SMTPID": 789
}'{
"Success": true,
"ErrorCode": 0,
"SMTP": {
"SMTPID": 789,
"SMTPUsername": "smtp_user_xxx",
"SMTPPassword": "new_generated_password"
}
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (SMTPID)
2: SMTP credentials not found or access deniedCreate Webhook for Domain
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.addwebhook |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
| Event | String | Yes | Event type: delivery, bounce, open, click, unsubscribe, complaint |
| WebhookURL | String | Yes | Webhook URL to receive event notifications |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.addwebhook",
"SessionID": "your-session-id",
"DomainID": 123,
"Event": "delivery",
"WebhookURL": "https://example.com/webhooks/email-events"
}'{
"Success": true,
"ErrorCode": 0,
"NewWebhookID": 999
}{
"Success": false,
"ErrorCode": [3]
}0: Success
1: Missing required parameter (DomainID)
2: Missing required parameter (Event)
3: Invalid event type
4: Domain not found or access denied
5: Missing required parameter (WebhookURL)Get Domain Webhooks
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.getwebhooks |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.getwebhooks",
"SessionID": "your-session-id",
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0,
"SigningKey": "whsec_xxxxxxxxxxxx",
"Webhooks": [
{
"WebhookID": 999,
"Event": "delivery",
"WebhookURL": "https://example.com/webhooks/email-events"
}
]
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedDelete Domain Webhook
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.deletewebhook |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| WebhookID | Integer | Yes | Webhook ID to delete |
| DomainID | Integer | Yes | Sender domain ID |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.deletewebhook",
"SessionID": "your-session-id",
"WebhookID": 999,
"DomainID": 123
}'{
"Success": true,
"ErrorCode": 0
}{
"Success": false,
"ErrorCode": 4
}0: Success
1: Missing required parameter (WebhookID)
2: Missing required parameter (DomainID)
3: Domain not found or access denied
4: Webhook not found or access deniedCreate Webhook (Public API)
POST/api/v1/webhooksAPI Usage Notes
- Authentication required: Bearer token
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| SenderAPIKey | String | Yes | API key for the sender domain (Bearer token) |
| Event | String | Yes | Event type: delivered, bounced, opened, clicked, unsubscribed, complained |
| WebhookURL | String | Yes | Webhook URL to receive event notifications |
curl -X POST https://example.com/api/v1/webhooks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eg_live_xxxxxxxxxxxx" \
-d '{
"Event": "delivered",
"WebhookURL": "https://example.com/webhooks/email-events"
}'{
"NewWebhookID": 999
}{
"Errors": [
{"Code": 3, "Message": "Invalid Event value"}
]
}2: Event is missing
3: Invalid event type or invalid webhook URL
5: WebhookURL is missing
13: Invalid SenderAPIKey
429: Too many requestsGet Webhooks (Public API)
GET/api/v1/webhooksAPI Usage Notes
- Authentication required: Bearer token
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| SenderAPIKey | String | Yes | API key for the sender domain (Bearer token) |
curl -X GET https://example.com/api/v1/webhooks \
-H "Authorization: Bearer eg_live_xxxxxxxxxxxx"{
"Webhooks": [
{
"WebhookID": 999,
"Event": "delivered",
"WebhookURL": "https://example.com/webhooks/email-events"
}
]
}{
"Errors": [
{"Code": 13, "Message": "Invalid SenderAPIKey"}
]
}2: Invalid user account
13: Invalid SenderAPIKey
429: Too many requestsDelete Webhook (Public API)
DELETE/api/v1/webhooksAPI Usage Notes
- Authentication required: Bearer token
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| SenderAPIKey | String | Yes | API key for the sender domain (Bearer token) |
| WebhookID | Integer | Yes | Webhook ID to delete |
curl -X DELETE https://example.com/api/v1/webhooks \
-H "Authorization: Bearer eg_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"WebhookID": 999
}'{}{
"Errors": [
{"Code": 4, "Message": "Invalid WebhookID"}
]
}1: WebhookID is missing
2: Invalid user account
4: Invalid WebhookID
13: Invalid SenderAPIKey
429: Too many requestsGet Email Events
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.getevents |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
| StartFrom | Integer | Yes | Starting record index for pagination |
| RetrieveCount | Integer | Yes | Number of records to retrieve (max 100) |
| StartDate | String | No | Start date filter (Y-m-d format) |
| EndDate | String | No | End date filter (Y-m-d format) |
| Event | String | No | Filter by event type (delivery, bounce, open, click, etc.) |
| Query | String | No | Search query string |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.getevents",
"SessionID": "your-session-id",
"DomainID": 123,
"StartFrom": 0,
"RetrieveCount": 50,
"Event": "delivery"
}'{
"Success": true,
"ErrorCode": 0,
"TotalRecords": 150,
"Events": [
{
"event": "delivery",
"timestamp": 1640000000,
"message": {
"headers": {
"from": "sender@example.com",
"to": "recipient@example.com",
"subject": "Test Email"
}
}
}
]
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access denied
4: Missing required parameter (StartFrom)
5: Missing required parameter (RetrieveCount)Get Email Events (Public API)
GET/api/v1/eventsAPI Usage Notes
- Authentication required: Bearer token
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| SenderAPIKey | String | Yes | API key for the sender domain (Bearer token) |
| StartFrom | Integer | No | Starting record index for pagination (default: 0) |
| RetrieveCount | Integer | No | Number of records to retrieve (default: 5, max 100) |
| StartDate | Integer | No | Start date filter (Unix timestamp) |
| EndDate | Integer | No | End date filter (Unix timestamp) |
| Event | String | No | Filter by event type |
| MessageID | String | No | Filter by message ID |
curl -X GET https://example.com/api/v1/events \
-H "Authorization: Bearer eg_live_xxxxxxxxxxxx" \
-d '{
"StartFrom": 0,
"RetrieveCount": 50,
"Event": "delivery"
}'{
"TotalRecords": 150,
"Events": [
{
"Event": "delivery",
"LoggedAt": 1640000000,
"Message": {
"Headers": {
"From": "sender@example.com",
"To": "recipient@example.com",
"Subject": "Test Email"
}
}
}
]
}{
"Errors": [
{"Code": 13, "Message": "Invalid SenderAPIKey"}
]
}1: Missing SenderAPIKey
2: Invalid sender domain
4: Missing StartFrom
5: Missing RetrieveCount
13: Invalid SenderAPIKey
429: Too many requestsGet Aggregated Event Statistics
POST/api.phpAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured)
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.aggrevents |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| DomainID | Integer | Yes | Sender domain ID |
| StartDate | String | No | Start date filter (Y-m-d format) |
| EndDate | String | No | End date filter (Y-m-d format) |
| AggregatedField | String | No | Field to aggregate by |
| AggregateSize | Integer | No | Number of aggregation buckets |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.aggrevents",
"SessionID": "your-session-id",
"DomainID": 123,
"StartDate": "2024-01-01",
"EndDate": "2024-01-31"
}'{
"Success": true,
"ErrorCode": 0,
"AggBuckets": [
{
"key": "delivery",
"doc_count": 1000
},
{
"key": "bounce",
"doc_count": 50
}
]
}{
"Success": false,
"ErrorCode": 2
}0: Success
1: Missing required parameter (DomainID)
2: Domain not found or access deniedSend Email via API
POST/api/v1/emailAPI Usage Notes
- Authentication required: Bearer token
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| SenderAPIKey | String | Yes | API key for the sender domain (Bearer token) |
| Subject | String | Yes | Email subject line |
| ContentType | String | Yes | Content type: html or plain |
| HTMLContent | String | Conditional | HTML email content (required if ContentType is html) |
| PlainContent | String | Conditional | Plain text email content (required if ContentType is plain) |
| From | Object | Yes | Sender information: |
| To | Array | Conditional | Array of recipients: [{name, email}] (required unless TargetListID is set) |
| CC | Array | No | Array of CC recipients: [{name, email}] |
| BCC | Array | No | Array of BCC recipients: [{name, email}] |
| ReplyTo | Array | No | Array of reply-to addresses: [{name, email}] |
| Tags | Array | No | Array of custom tags for tracking |
| Headers | Object | No | Custom email headers as key-value pairs |
| TrackLinks | String | No | Enable link tracking: true or false |
| TrackOpens | String | No | Enable open tracking: true or false |
| SendAt | Integer | No | Schedule send time (Unix timestamp) |
| Attachments | Array | No | Array of attachments: [{filename, content, type, disposition, contentid}] |
| TemplateID | Integer | No | Email template ID to use |
| TargetListID | Integer | No | Send to all subscribers in a list |
| ListID | Integer | No | List ID for subscriber context |
| SubscriberID | Integer | No | Subscriber ID for personalization |
| JourneyID | Integer | No | Journey ID for tracking |
| ActionID | Integer | No | Journey action ID for tracking |
curl -X POST https://example.com/api/v1/email \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eg_live_xxxxxxxxxxxx" \
-d '{
"Subject": "Welcome to Our Service",
"ContentType": "html",
"HTMLContent": "<h1>Welcome!</h1><p>Thank you for signing up.</p>",
"From": {
"name": "John Doe",
"email": "john@example.com"
},
"To": [
{
"name": "Jane Smith",
"email": "jane@example.com"
}
]
}'{
"MessageID": "550e8400-e29b-41d4-a716-446655440000"
}{
"Errors": [
{"Code": 8, "Message": "Missing Subject"}
]
}1: Missing SenderAPIKey
2: Invalid DomainID or invalid user account
3: From parameter is missing or invalid
8: Missing Subject or To email address
9: Missing ContentType
10: Missing HTMLContent
11: Missing PlainContent
12: Invalid or deactivated user account
13: Invalid SenderAPIKey
14: Email address is in the suppression list
15: Invalid TemplateID
16: Invalid TargetListID
17: Email sending limit reached
18: Recipient name or email address is missing
19: Recipient email address is invalid
20: There is no recipient set or count exceeds limit
21-22: CC email validation errors
23: Invalid from email address format
24-26: BCC email validation errors
27: BCC count exceeds limit
28-30: Reply-To email validation errors
31: Reply-To count exceeds limit
32: Domain is not activated
34: User account is not verified
35: Invalid ListID
36: Invalid SubscriberID
37: Invalid JourneyID
38: Invalid ActionID
429: Email send rate limit exceededSend Email via SMTP Relay
POST/api.phpAPI Usage Notes
- Authentication required: Admin API Key
- Required permissions:
EmailGateway.ManageDomain - Legacy endpoint access via
/api.phponly (no v1 REST alias configured) - This is an internal endpoint used by the SMTP relay server
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: emailgateway.smtprelay |
| AdminAPIKey | String | Yes | Admin API key for authentication |
| SMTPUsername | String | Yes | SMTP username for authentication |
| SMTPPassword | String | Yes | SMTP password for authentication |
| UUID | String | No | Unique message identifier |
| MailFrom | String | No | MAIL FROM envelope address |
| RcptTo | String | No | RCPT TO envelope addresses (comma-separated) |
| Subject | String | No | Email subject line |
| RawEmail | String | No | Raw email content (RFC 822 format) |
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.smtprelay",
"AdminAPIKey": "your-admin-key",
"SMTPUsername": "smtp_user_xxx",
"SMTPPassword": "smtp_password"
}'curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
"Command": "emailgateway.smtprelay",
"AdminAPIKey": "your-admin-key",
"SMTPUsername": "smtp_user_xxx",
"SMTPPassword": "smtp_password",
"UUID": "550e8400-e29b-41d4-a716-446655440000",
"MailFrom": "sender@example.com",
"RcptTo": "recipient@example.com",
"Subject": "Test Email",
"RawEmail": "From: sender@example.com..."
}'{
"Success": true,
"ErrorCode": 0,
"SMTPUsername": "smtp_user_xxx",
"SMTPPassword": "smtp_password"
}{
"Success": true,
"ErrorCode": 0,
"SMTPResponse": "250 2.0.0 Ok: queued",
"SMTPUsername": "smtp_user_xxx",
"SMTPPassword": "smtp_password"
}{
"Success": false,
"SMTPResponse": "500 5.0.0 AUTH ERROR",
"ErrorCode": 3
}0: Success
1: Missing SMTPUsername
2: Missing SMTPPassword
3: Invalid SMTP credentials
4: Invalid sender domain
5: Sender domain is not active
6: Invalid user account
7: User is not trusted or not enabled
8: Recipient email address is suppressedGet All Sender Domains for PowerMTA Configuration
POST/api/v1/sender.domainsAPI Usage Notes
- Authentication required: Admin API Key
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | No | API command: sender.domains (only required for legacy endpoint) |
| AdminAPIKey | String | No | Admin API key for authentication (only required for legacy endpoint) |
| DomainsResponseFormat | String | No | Response format: json, powermta-bounce-domains, powermta-relay-domains (default: json) |
curl -X POST https://example.com/api/v1/sender.domains \
-H "Content-Type: application/json" \
-d '{
"DomainsResponseFormat": "json"
}'{
"Success": true,
"Domains": [
"example.com",
"another.com",
"third.com"
]
}{
"Success": false,
"ErrorCode": 1,
"ErrorText": "Invalid DomainsResponseFormat"
}0: Success
1: Invalid DomainsResponseFormat (must be json, powermta-bounce-domains, or powermta-relay-domains)Check Inbound Relay Domain Authorization
GET/api/v1/inbound-relay-domain-checkAPI Usage Notes
- Authentication required: Bearer token (Admin API Key)
- This endpoint is designed for MX server integration to validate relay domains
- Returns HTTP status codes to indicate relay authorization
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Domain | String | Yes | Domain name to check for relay authorization (can be full email address) |
curl -X GET "https://example.com/api/v1/inbound-relay-domain-check?domain=example.com" \
-H "Authorization: Bearer your-admin-api-key"{
"Success": true,
"RelayDomain": "example.com"
}{
"Errors": [
{
"Code": 1,
"Message": "Authentication failed. Invalid admin API key."
}
]
}{}200: Relay allowed - domain is authorized for relay
403: Temporary error - authentication failed
500: Relay access denied - domain is not authorized1: Authentication failed - Invalid admin API key
Developer Portal