Zapmail
latest
  • latest
  • v1
  1. dns
Zapmail
latest
  • latest
  • v1
  • Zapmail Docs
  • users
    • Retrieve User Details
      GET
  • workspaces
    • Retrieve all workspaces
      GET
    • Create new workspace
      POST
    • Update workspace
      PUT
  • billing
    • Add Billing Details
      POST
    • Update Billing Details
      PUT
  • mailbox
    • Retrieve All Mailboxes
      GET
    • Get Mailbox Details by ID
      GET
    • Assign New Mailboxes to Domains
      POST
    • Update mailbox
      PUT
    • Remove mailboxes on next renewal
      PUT
    • Get Authenticator code
      GET
    • Remove Mailboxes Instantly
      POST
    • Custom OAuth
      POST
  • payments & wallet
    • Add balance to wallet
      POST
    • Get wallet balance
      GET
    • Enable auto recharge
      POST
  • export
    • Export mailboxes
      POST
    • Add third party account details
      POST
    • Update third party account details
      PUT
  • subscriptions
    • Get all subscriptions
    • Cancel subscription
    • Upgrade existing subscription
    • Purchase subscription
  • domains
    • Retrieve All Domains
    • List Assignable Domains
    • Add DMARC record
    • Add Domain forwarding
    • Get Name servers to connect domain
    • Verify Name Server Propagation
    • Connect Domain with Zapmail
    • Enable email forwarding
    • Remove email forwarding
    • Enable catch all emails
    • Remove catch all emails
    • Check DNS records
    • Remove unused domains
    • Get available domains for registration
    • Get domains purchase payment link
    • Get domain connection requests
    • Remove domain connection requests
    • Connect Domain with Zapmail (New)
    • Add Google Client ID to Domain
    • Get availability of multiple domain names.
    • Retrieve Domain Health Score
    • Retrieve All Domains (With filters)
  • dns
    • Get dns records
      GET
    • Add dns records
      POST
    • Update dns records
      PUT
    • Delete dns records
      DELETE
  • aged domains
    • Get available domains
    • Purchase aged domains
  • prewarmed domains
    • Get prewarmed domains
    • purchase prewarmed subscription
    • Assign prewarmed mailboxes
  • placement test
    • Get subscriptions
    • Get Overall Report
    • Get placement test orders
    • Get report by cart order id
    • Get Eligible Mailboxes for Placement Tests
    • Get Available Placement Test Credits
    • Purchase Placement Test
    • Purchase plan
  • dns shield
    • Get eligible domains
    • Get available slots
    • Get subscriptions
    • Get Allocated Domains for Subscription
    • Allocate Domains to DNS Shield
    • Purchase DNS Shield
    • Upgrade DNS Shield LTD Plan
    • Cancel subscription
  • Schemas
    • domain with filter
  1. dns

Add dns records

POST
/v2/dns
Add DNS Records for a given domain.
NameTypeDescription
assignedDomainIdstringThe unique identifier for the domain to which DNS records are assigned. (domainId)
recordsarrayA list of DNS records associated with the domain.

records Array Structure#

NameTypeDescription
hoststringThe domain or subdomain for which the DNS record applies.
valuestringThe corresponding value of the DNS record, such as an IP address or another domain.
recordTypestringThe type of DNS record (e.g., A, CNAME, MX, TXT).

Request

Header Params

Body Params application/json

Example
{
  "assignedDomainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "records": [
    {
      "host": "@",
      "value": "203.0.113.1",
      "recordType": "A"
    },
    {
      "host": "blog",
      "value": "example.com",
      "recordType": "CNAME"
    },
    {
      "host": "_dmarc",
      "value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
      "recordType": "TXT"
    },
    {
      "host": "@",
      "value": "2001:db8::1",
      "recordType": "AAAA"
    }
  ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.zapmail.ai/api/v2/dns' \
--header 'x-auth-zapmail;' \
--header 'x-workspace-key;' \
--header 'x-service-provider;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "assignedDomainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "records": [
    {
      "host": "@",
      "value": "203.0.113.1",
      "recordType": "A"
    },
    {
      "host": "blog",
      "value": "example.com",
      "recordType": "CNAME"
    },
    {
      "host": "_dmarc",
      "value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
      "recordType": "TXT"
    },
    {
      "host": "@",
      "value": "2001:db8::1",
      "recordType": "AAAA"
    }
  ]
}'

Responses

🟢200Success
application/json
Body

Example
{
    "status": 200,
    "message": "Dns records added successfully",
    "data": [
        {
            "id": "11111111-1111-1111-1111-111111111111",
            "value": "123.123.123.123",
            "host": "dummy.com",
            "recordType": "A",
            "assignedDomainId": "22222222-2222-2222-2222-222222222222",
            "cdfRecordId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "cdfResponse": {
                "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "name": "dummy.com.dns-records.test",
                "type": "A",
                "content": "123.123.123.123"
            },
            "priority": null,
            "createdAt": "2025-01-31T09:03:21.984Z",
            "updatedAt": "2025-01-31T09:03:21.984Z",
            "deletedAt": null
        },
        {
            "id": "33333333-3333-3333-3333-333333333333",
            "value": "dummy-mailserver.com",
            "host": "mail.dummy.com",
            "recordType": "CNAME",
            "assignedDomainId": "22222222-2222-2222-2222-222222222222",
            "cdfRecordId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
            "cdfResponse": {
                "id": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
                "name": "mail.dummy.com.dns-records.test",
                "type": "CNAME",
                "content": "dummy-mailserver.com"
            },
            "priority": null,
            "createdAt": "2025-01-31T09:03:21.984Z",
            "updatedAt": "2025-01-31T09:03:21.984Z",
            "deletedAt": null
        }
    ]
}
🟠400Not registered
Modified at 2025-10-14 09:23:55
Previous
Get dns records
Next
Update dns records
Built with