> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete an email domain



## OpenAPI

````yaml /openapi/generated/email/domains.yml delete /email_domains/{id}
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: API for managing email domains, DNS records, verification, and webhooks.
  title: Telnyx Email Domains API
  version: 2.0.0
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /email_domains/{id}:
    delete:
      tags:
        - Email Domains
      summary: Delete an email domain
      operationId: deleteEmailDomain
      parameters:
        - $ref: '#/components/parameters/EmailDomainId'
        - name: force
          in: query
          required: false
          description: Required as true when deleting verified domains
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Email domain deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailDomainResponse'
        '403':
          description: >-
            Forbidden — shared domains are read-only for non-owner accounts
            (error code 10008).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainsErrorResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '500':
          $ref: '#/components/responses/InternalServerError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

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

            await client.emailDomains.delete('id');
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            client.email_domains.delete(
                "id",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.EmailDomains.Delete(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    client.emailDomains().delete("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            email_domain = telnyx.email_domains.delete("id")

            puts(email_domain)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $email_domain = $client->emailDomains->delete(
                'id',
              );

              var_dump($email_domain);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx email-domains delete \
              --api-key 'My API Key' \
              --id id
components:
  parameters:
    EmailDomainId:
      name: id
      in: path
      required: true
      description: Email domain UUID
      schema:
        type: string
        format: uuid
  schemas:
    EmailDomainResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/EmailDomain'
    DomainsErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/email_Error'
    EmailDomain:
      type: object
      required:
        - id
        - record_type
        - domain
        - type
        - status
        - usable_for_sending
        - usable_for_inbound
        - verification
        - dns_records
        - dkim
        - inbound
        - dmarc_policy
        - tracking
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        record_type:
          type: string
          enum:
            - email_domain
        domain:
          type: string
          example: example.com
        type:
          $ref: '#/components/schemas/EmailDomainType'
          description: >-
            Domain type. `custom` domains are account-owned (BYOD). `shared`
            domains are Telnyx-managed, visible to and usable by ALL accounts
            for sending, but read-only: only the owning (system) account may
            modify, verify, or delete them; other accounts receive 403 (code
            10008).
        status:
          $ref: '#/components/schemas/EmailDomainStatus'
        usable_for_sending:
          type: boolean
        usable_for_inbound:
          type: boolean
        verification:
          $ref: '#/components/schemas/EmailDomainVerification'
        dns_records:
          type: array
          items:
            $ref: '#/components/schemas/DNSRecord'
        dkim:
          $ref: '#/components/schemas/DKIMStatus'
        inbound:
          $ref: '#/components/schemas/InboundConfig'
        dmarc_policy:
          type:
            - object
            - 'null'
          allOf:
            - $ref: '#/components/schemas/EmailDMARCPolicy'
          description: >
            Customer DMARC policy. null means use the advisory default
            (v=DMARC1; p=none; rua=mailto:dmarc@telnyx.com).
        tracking:
          $ref: '#/components/schemas/DomainsTrackingSettings'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        verified_at:
          type:
            - string
            - 'null'
          format: date-time
        reputation:
          type: object
          description: Sender reputation for this domain (present on all domain responses).
          properties:
            band:
              type: string
              description: Reputation band, e.g. good/warn/poor.
            breakdown:
              type: object
              additionalProperties: true
            computed_at:
              type:
                - string
                - 'null'
              format: date-time
      example:
        id: 123e4567-e89b-12d3-a456-426614174000
        record_type: email_domain
        domain: example.com
        type: custom
        status: pending
        usable_for_sending: false
        usable_for_inbound: false
        verification:
          ownership: pending
          spf: missing_optional
          dkim: pending
          dmarc: missing_optional
          mx: not_required
        dns_records: []
        dkim:
          selector: null
          algorithm: null
          key_length: null
          active: false
          rotated_at: null
        inbound:
          enabled: false
          catch_all: false
          mx_required: false
        dmarc_policy:
          p: none
          pct: 100
          rua: mailto:dmarc@telnyx.com
        tracking:
          open_tracking: false
          click_tracking: false
          unsubscribe_tracking: false
        created_at: '2026-01-01T00:00:00Z'
        updated_at: '2026-01-01T00:00:00Z'
        verified_at: null
    email_Error:
      type: object
      required:
        - code
        - title
        - detail
      properties:
        code:
          type: string
          enum:
            - '10001'
            - '10015'
            - '500'
            - '10007'
            - '10008'
            - '10020'
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
    EmailDomainType:
      type: string
      enum:
        - custom
        - shared
        - shared_inbound
    EmailDomainStatus:
      type: string
      enum:
        - pending
        - verifying
        - verified
        - failed
        - degraded
        - suspended
    EmailDomainVerification:
      type: object
      required:
        - ownership
        - spf
        - dkim
        - dmarc
        - mx
      properties:
        ownership:
          type: string
          enum:
            - pending
            - verified
            - not_required
        spf:
          type: string
          enum:
            - missing_optional
            - verified
            - failed
            - not_required
        dkim:
          type: string
          enum:
            - pending
            - verified
            - failed
        dmarc:
          type: string
          enum:
            - missing_optional
            - verified
            - failed
        mx:
          type: string
          enum:
            - not_required
            - pending
            - verified
            - failed
    DNSRecord:
      type: object
      required:
        - id
        - purpose
        - record_type
        - host
        - value
        - required
        - status
      properties:
        id:
          type: string
          format: uuid
        purpose:
          type: string
          enum:
            - ownership
            - spf
            - dkim
            - dmarc
            - mx
        record_type:
          type: string
          enum:
            - TXT
            - MX
        host:
          type: string
        value:
          type: string
        actual_value:
          type:
            - string
            - 'null'
        priority:
          type:
            - integer
            - 'null'
        required:
          type: boolean
        status:
          type: string
          enum:
            - pending
            - verified
            - failed
            - not_required
      example:
        id: 123e4567-e89b-12d3-a456-426614174001
        purpose: ownership
        record_type: TXT
        host: _telnyx-email.example.com
        value: telnyx-domain-verification=abc123
        actual_value: null
        priority: null
        required: true
        status: pending
    DKIMStatus:
      type: object
      required:
        - selector
        - algorithm
        - key_length
        - active
        - rotated_at
      properties:
        selector:
          type:
            - string
            - 'null'
        algorithm:
          type:
            - string
            - 'null'
          enum:
            - rsa-sha256
            - null
        key_length:
          type:
            - integer
            - 'null'
          enum:
            - 2048
            - null
        active:
          type: boolean
        rotated_at:
          type:
            - string
            - 'null'
          format: date-time
    InboundConfig:
      type: object
      required:
        - enabled
        - catch_all
        - mx_required
      properties:
        enabled:
          type: boolean
        catch_all:
          type: boolean
        mx_required:
          type: boolean
    EmailDMARCPolicy:
      type: object
      description: >-
        DMARC policy for a sending domain. Drives the recommended
        _dmarc.<domain> TXT record. DMARC is advisory and never blocks sending.
        When omitted or null, the domain uses the advisory default (v=DMARC1;
        p=none; rua=mailto:dmarc@telnyx.com).
      properties:
        p:
          type: string
          enum:
            - none
            - quarantine
            - reject
          default: none
          description: Policy applied to messages that fail alignment.
        pct:
          type: integer
          minimum: 0
          maximum: 100
          default: 100
          description: >-
            Percentage of messages the policy applies to. Omitted from the
            record when 100.
        rua:
          type:
            - string
            - 'null'
          description: >-
            URI for aggregate reports. Defaults to the Telnyx address when
            absent; null omits it.
        sp:
          type:
            - string
            - 'null'
          enum:
            - none
            - quarantine
            - reject
            - null
          description: Policy for subdomains. Omitted from the record when null.
    DomainsTrackingSettings:
      type: object
      properties:
        open_tracking:
          type: boolean
          default: false
          description: Inject a tracking pixel into HTML messages to record open events.
        click_tracking:
          type: boolean
          default: false
          description: >-
            Rewrite HTML links through a tracking redirect to record click
            events.
        unsubscribe_tracking:
          type: boolean
          default: true
          description: >-
            Add RFC 8058 List-Unsubscribe headers with a signed one-click
            unsubscribe URL. Enabled by default; Gmail/Yahoo bulk-sender rules
            require one-click unsubscribe support.
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainsErrorResponse'
          example:
            errors:
              - code: '10001'
                title: Not Found
                detail: The requested email domain was not found
    ValidationFailed:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainsErrorResponse'
          example:
            errors:
              - code: '10015'
                title: Validation Failed
                detail: domain is invalid
                source:
                  pointer: /data/attributes/domain
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainsErrorResponse'
          example:
            errors:
              - code: '500'
                title: Internal Server Error
                detail: An unexpected error occurred
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````