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

# Delete Domain

> Delete a domain owned by the authenticated workspace. Domain-scoped secret keys may delete only domains in their allowlist. Deletion is rejected while the domain is used by templates, workflow steps, or active campaigns.



## OpenAPI

````yaml openapi.json DELETE /v1/domains/{id}
openapi: 3.0.3
info:
  title: MailGlyph API
  description: >-
    Email platform API for transactional emails, campaigns, and marketing
    automation
  version: 1.0.0
  contact:
    name: MailGlyph Support
    url: https://mailglyph.com
servers:
  - url: https://api.mailglyph.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Public API
    description: Public API endpoints for sending emails and tracking events
  - name: Events
    description: Event ingestion and querying
  - name: Contacts
    description: Contact management operations
  - name: Templates
    description: Email template management
  - name: Campaigns
    description: Email campaign management
  - name: Segments
    description: Audience segmentation
  - name: Workflows
    description: Workflow automation
paths:
  /v1/domains/{id}:
    delete:
      tags:
        - Domains
      summary: Delete a sending domain
      description: >-
        Delete a domain owned by the authenticated workspace. Domain-scoped
        secret keys may delete only domains in their allowlist. Deletion is
        rejected while the domain is used by templates, workflow steps, or
        active campaigns.
      operationId: deleteDomain
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Domain deleted
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
        '403':
          description: >-
            The API key is not scoped to this domain or the workspace is
            disabled
        '404':
          description: Domain not found
        '409':
          description: >-
            The domain is still used by a template, workflow step, or active
            campaign
        '422':
          description: Invalid domain ID
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key authentication. **Secret keys (sk_*)** are required for all
        endpoints except `/v1/track`. **Public keys (pk_*)** only work with the
        `/v1/track` endpoint for client-side event tracking. Workspaces can have
        multiple active keys, and sender-domain operations enforce per-key
        domain scope when configured.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.