Create relay domain

Create (add) a relay domain

  • HTTP Method: POST
  • URL: https://example.domain.tld/api/v1/relaydomains/
  • Require authentication: Yes
  • Permission level required: MasterAdmin / DomainAdmin

Request parameters

Parameter Type Description Required
relay_domain str Relay domain name Required
destination_hostname str Destination hostname Required
destination_port int Destination port Required

Response parameters

Parameter Type Description
destination_hostname str Destination hostname
destination_port int Destination port
expire_time int Expire time for domain verification as UNIX timestamp (seconds)
relay_domain str Relay domain name
status str Verification status
verification_code str Verification code
verification_type str Verification type

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/relaydomains/"
data = {
"relay_domain" : "test.vonmail.com",
"destination_hostname" : "mail3.mymailcheap.com",
"destination_port" : 25
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except: 
    print(r.text)

Example response (JSON)

{'destination_hostname': 'mail3.mymailcheap.com',
 'destination_port': 25,
 'expire_time': 1583667188,
 'relay_domain': 'test.vonmail.com',
 'status': 'pending_verification',
 'verification_code': 'nms-domain-verification=797147642125',
 'verification_type': 'DNS TXT'}