Skip to content
Start here

Disable Email Routing

client.emailRouting.dns.delete(DNSDeleteParams { zone_id } params, RequestOptionsoptions?): SinglePage<DNSRecord { content, name, priority, 2 more } >
DELETE/zones/{zone_id}/email/routing/dns

Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.

Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zone Settings Write
ParametersExpand Collapse
params: DNSDeleteParams { zone_id }
zone_id: string

Identifier.

maxLength32
ReturnsExpand Collapse
DNSRecord { content, name, priority, 2 more }

List of records needed to enable an Email Routing zone.

content?: string

DNS record content.

name?: string

DNS record name (or @ for the zone apex).

maxLength255
priority?: number

Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred.

maximum65535
minimum0
ttl?: number | 1

Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'.

One of the following:
number
1
type?: "A" | "AAAA" | "CNAME" | 15 more

DNS record type.

One of the following:
"A"
"AAAA"
"CNAME"
"HTTPS"
"TXT"
"SRV"
"LOC"
"MX"
"NS"
"CERT"
"DNSKEY"
"DS"
"NAPTR"
"SMIMEA"
"SSHFP"
"SVCB"
"TLSA"
"URI"

Disable Email Routing

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const dnsRecord of client.emailRouting.dns.delete({
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
})) {
  console.log(dnsRecord.content);
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true
}