| Name | Type | Description |
|---|---|---|
assignedDomainId | string | The unique identifier for the domain to which DNS records are assigned. (domainId) |
records | array | A list of DNS records associated with the domain. |
records Array Structure#| Name | Type | Description |
|---|---|---|
host | string | The domain or subdomain for which the DNS record applies. |
value | string | The corresponding value of the DNS record, such as an IP address or another domain. |
recordType | string | The type of DNS record (e.g., A, CNAME, MX, TXT). |
{
"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"
}
]
}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"
}
]
}'{
"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
}
]
}