Delete a sending subdomain
client.EmailSending.Subdomains.Delete(ctx, subdomainID, body) (*SubdomainDeleteResponse, error)
DELETE/zones/{zone_id}/email/sending/subdomains/{subdomain_id}
Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.
Security
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Delete a sending subdomain
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/email_sending"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
subdomain, err := client.EmailSending.Subdomains.Delete(
context.TODO(),
"aabbccdd11223344aabbccdd11223344",
email_sending.SubdomainDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subdomain.Errors)
}
{
"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
}