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

# Delete domain

> Deletes a domain from the system.


**🎯 Purpose:**
Delete a domain from your SendX team. This action removes the domain configuration and all associated settings.

**⚠️ Important Considerations:**

* Deleting a domain is permanent and cannot be undone
* Any senders using this domain may be affected
* DNS records should be removed from your DNS provider separately
* Consider the impact on active campaigns

**💡 Use Cases:**

* Remove unused or test domains
* Clean up domains that are no longer needed
* Replace domains with new configurations
* Remove domains with failed verifications

**🔒 Before Deleting:**

1. Ensure no active campaigns are using this domain
2. Check that no senders depend on this domain
3. Verify you have backups of DNS configurations if needed
4. Consider the impact on email deliverability

**⚡ Best Practices:**

* Only delete domains that are truly no longer needed
* Document DNS configurations before deletion
* Remove DNS records from your DNS provider after deletion
* Update any automation or integrations that reference this domain


## OpenAPI

````yaml delete /domain/{identifier}
openapi: 3.1.0
info:
  title: SendX REST API
  version: 1.0.0
  description: >
    # SendX REST API Documentation


    ## 🚀 Introduction


    The SendX API is organized around REST principles. Our API has predictable
    resource-oriented URLs, accepts JSON-encoded request bodies, returns
    JSON-encoded responses, and uses standard HTTP response codes,
    authentication, and verbs.


    **Key Features:**

    - 🔒 **Security**: Team-based authentication with optional member-level
    access

    - 🎯 **Resource-Oriented**: RESTful design with clear resource boundaries

    - 📊 **Rich Data Models**: Three-layer model system (Input/Output/Internal)

    - 🔗 **Relationships**: Automatic prefix handling for resource relationships

    - 📈 **Scalable**: Built for high-volume email marketing operations


    ## 🏗️ Architecture Overview


    SendX uses a three-layer model architecture:


    1. **Input Models** (`RestE*`): For API requests

    2. **Output Models** (`RestR*`): For API responses with prefixed IDs

    3. **Internal Models**: Core business logic (not exposed in API)


    ## 🔐 Security & Authentication


    SendX uses API key authentication:


    ### Team API Key

    ```http

    X-Team-ApiKey: YOUR_TEAM_API_KEY

    ```

    - **Required for all requests**

    - Team-level access to resources

    - Available in SendX Settings → Team API Key


    ## 🆔 Encrypted ID System


    SendX uses encrypted IDs for security and better developer experience:


    - **Internal IDs**: Sequential integers (not exposed)

    - **Encrypted IDs**: 22-character alphanumeric strings

    - **Prefixed IDs**: Resource-type prefixes in API responses
    (`contact_<22-char-id>`)


    ### ID Format


    **All resource IDs follow this pattern:**

    ```

    <resource_prefix>_<22_character_alphanumeric_string>

    ```


    **Example:**

    ```json

    {
      "id": "contact_BnKjkbBBS500CoBCP0oChQ",
      "lists": ["list_OcuxJHdiAvujmwQVJfd3ss", "list_0tOFLp5RgV7s3LNiHrjGYs"],
      "tags": ["tag_UhsDkjL772Qbj5lWtT62VK", "tag_fL7t9lsnZ9swvx2HrtQ9wM"]
    }

    ```


    ## 📚 Resource Prefixes


    | Resource | Prefix | Example |

    |----------|--------|---------|

    | Contact | `contact_` | `contact_BnKjkbBBS500CoBCP0oChQ` |

    | Campaign | `campaign_` | `campaign_LUE9BTxmksSmqHWbh96zsn` |

    | List | `list_` | `list_OcuxJHdiAvujmwQVJfd3ss` |

    | Tag | `tag_` | `tag_UhsDkjL772Qbj5lWtT62VK` |

    | Sender | `sender_` | `sender_4vK3WFhMgvOwUNyaL4QxCD` |

    | Template | `template_` | `template_f3lJvTEhSjKGVb5Lwc5SWS` |

    | Custom Field | `custom_field_` | `field_MnuqBAG2NPLm7PZMWbjQxt` |

    | Webhook | `webhook_` | `webhook_9l154iiXlZoPo7vngmamee` |

    | Post | `post_` | `post_XyZ123aBc456DeF789GhI` |

    | Post Category | `post_category_` | `post_category_YzS1wOU20yw87UUHKxMzwn`
    |

    | Post Tag | `post_tag_` | `post_tag_123XyZ456AbC` |

    | Member | `member_` | `member_JkL012MnO345PqR678` |

    | Domain | `domain_` | `domain_504` |


    ## 🎯 Best Practices


    ### Error Handling

    - **Always check status codes**: 2xx = success, 4xx = client error, 5xx =
    server error

    - **Read error messages**: Descriptive messages help debug issues

    - **Handle rate limits**: Respect API rate limits for optimal performance


    ### Data Validation

    - **Email format**: Must be valid email addresses

    - **Required fields**: Check documentation for mandatory fields

    - **Field lengths**: Respect maximum length constraints


    ### Performance

    - **Pagination**: Use offset/limit for large datasets

    - **Batch operations**: Process multiple items when supported

    - **Caching**: Cache responses when appropriate


    ## 🛠️ SDKs & Integration


    Official SDKs available for:

    - [Golang](https://github.com/sendx/sendx-go-sdk)

    - [Python](https://github.com/sendx/sendx-python-sdk)

    - [Ruby](https://github.com/sendx/sendx-ruby-sdk)

    - [Java](https://github.com/sendx/sendx-java-sdk)

    - [PHP](https://github.com/sendx/sendx-php-sdk)

    - [JavaScript](https://github.com/sendx/sendx-javascript-sdk)


    ## 📞 Support


    Need help? Contact us:

    - 💬 **Website Chat**: Available on sendx.io

    - 📧 **Email**: hello@sendx.io

    - 📚 **Documentation**: Full guides at help.sendx.io


    ---


    **API Endpoint:** `https://api.sendx.io/api/v1/rest`


    [<img src="https://run.pstmn.io/button.svg" alt="Run In Postman"
    style="width: 128px; height:
    32px;">](https://god.gw.postman.com/run-collection/33476323-44b198b0-5219-4619-a01f-cfc24d573885?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-44b198b0-5219-4619-a01f-cfc24d573885%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e)
  contact:
    name: SendX API Support
    email: hello@sendx.io
    url: https://sendx.io
  license:
    name: Proprietary
    url: https://sendx.io/terms
servers:
  - url: https://api.sendx.io/api/v1/rest
    description: Production server
security:
  - TeamApiKey: []
tags:
  - name: Contact
    description: >
      **Contact Management**


      Contacts are the core of your SendX account. They represent your
      customers, leads, or any person you wish to communicate with through
      marketing campaigns.


      **Key Features:**

      - ✅ Create, read, update, and delete contacts

      - 🏷️ Associate with lists and tags

      - 📝 Store custom field data

      - 📊 Track engagement metrics

      - 🔒 Team-based access control


      **Business Rules:**

      - Email addresses must be unique within a team

      - Custom fields are created automatically if they don't exist

      - Tags are created automatically when assigned

      - Soft deletes preserve historical data
  - name: Campaign
    description: >
      **Campaign Management**


      Campaigns allow you to send targeted email marketing messages to your
      contacts.


      **Key Features:**

      - 📧 Create and manage email campaigns

      - 🎯 Target specific lists and segments

      - 📊 Track campaign performance

      - ⏰ Schedule campaigns for future delivery

      - 🔄 A/B testing support
  - name: List
    description: |
      **List Management**

      Lists help you organize contacts into groups for targeted messaging.

      **Key Features:**
      - 📁 Create and manage contact lists
      - 👥 Bulk operations on list members
      - 🔗 Associate with campaigns
      - 📊 Track list growth metrics
  - name: Tag
    description: |
      **Tag Management**

      Tags provide flexible contact categorization for advanced segmentation.

      **Key Features:**
      - 🏷️ Create and manage tags
      - 🔍 Advanced contact filtering
      - 🎯 Behavior-based tagging
      - 📊 Tag-based analytics
  - name: Sender
    description: |
      **Sender Management**

      Manage verified sender addresses for your campaigns.

      **Key Features:**
      - ✉️ Add and verify sender addresses
      - 🔐 Domain authentication
      - 📧 Default sender settings
  - name: Template
    description: |
      **Email Template Management**

      Create and manage reusable email templates for campaigns.

      **Key Features:**
      - 🎨 HTML and text templates
      - 🔄 Reusable across campaigns
      - 📱 Mobile-responsive designs
      - 🏷️ Personalization support
  - name: Custom Field
    description: |
      **Custom Field Management**

      Define custom data fields for storing additional contact information.

      **Key Features:**
      - 📝 Create custom data fields
      - 🔢 Support for various data types
      - 📊 Use in segmentation
      - 🔄 Bulk updates
  - name: Webhook
    description: |
      **Webhook Management**

      Configure webhooks to receive real-time event notifications.

      **Key Features:**
      - 🔔 Real-time event notifications
      - 🎯 Event filtering
      - 🔒 Secure payload delivery
      - 📊 Delivery status tracking
  - name: Email Sending
    description: |
      **Email Sending APIs**

      Send transactional and marketing emails programmatically.

      **Key Features:**
      - 📧 Send individual emails
      - 🎨 Template-based sending
      - 📎 Attachment support
      - 🔄 Personalization variables
  - name: Events
    description: |
      **Event Tracking**

      Track custom events and revenue data for advanced analytics.

      **Key Features:**
      - 📊 Custom event tracking
      - 💰 Revenue attribution
      - 🔗 Integration with analytics
      - 📈 Conversion tracking
  - name: Tracking
    description: |
      **Contact Tracking APIs**

      Legacy tracking endpoints for backward compatibility.

      **Key Features:**
      - 👤 Identify contacts
      - 🏷️ Track contact behavior
      - 📊 Update contact properties
      - ⚠️ Consider using newer endpoints
  - name: Report
    description: |
      **Reporting APIs**

      Access detailed reports and analytics data.

      **Key Features:**
      - 📊 Campaign performance metrics
      - 📈 Engagement analytics
      - 💰 Revenue reports
      - 📉 Trend analysis
  - name: Post
    description: |
      **Blog Post Management**

      Manage blog posts and content for your marketing efforts.

      **Key Features:**
      - 📝 Create and manage posts
      - 🏷️ Categorize with tags
      - 📁 Organize by categories
      - 🔍 SEO optimization
  - name: Post Category
    description: |
      **Post Category Management**

      Organize blog posts into categories.

      **Key Features:**
      - 📁 Create categories
      - 🔗 Associate posts
      - 📊 Category analytics
  - name: Post Tag
    description: |
      **Post Tag Management**

      Tag blog posts for better organization and discovery.

      **Key Features:**
      - 🏷️ Create post tags
      - 🔍 Improve discoverability
      - 📊 Tag-based filtering
  - name: Team Member
    description: |
      **Team Member Information**

      Access team member details (read-only).

      **Key Features:**
      - 👤 View member profiles
      - 📧 Access member information
      - 🔒 Read-only access
paths:
  /domain/{identifier}:
    delete:
      tags:
        - Domain
      summary: Delete domain
      description: |
        Deletes a domain from the system.
      operationId: deleteDomain
      parameters:
        - name: identifier
          in: path
          required: true
          description: Domain identifier to delete
          schema:
            type: string
            pattern: ^(domain_)?[a-zA-Z0-9]{22}$
      responses:
        '200':
          description: ✅ Domain deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - TeamApiKey: []
components:
  schemas:
    DeleteResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
          example: success
        message:
          type: string
          example: Resource deleted successfully
      required:
        - status
        - message
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
          example: error
        message:
          type: string
          description: Human-readable error message
          example: Invalid request format
      required:
        - status
        - message
  responses:
    Unauthorized:
      description: ❌ Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            message: The Team ID or API Key specified is not valid
    NotFound:
      description: ❌ Not Found - Resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Resource not found
    UnprocessableEntity:
      description: ❌ Unprocessable Entity - Invalid request format
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Request body is not in proper format
    InternalServerError:
      description: ❌ Internal Server Error - System error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Internal server error occurred
  securitySchemes:
    TeamApiKey:
      type: apiKey
      in: header
      name: X-Team-ApiKey
      description: >
        Team API key for authentication. Find your API key in SendX Settings →
        Team API Key.


        **Example:**

        ```

        X-Team-ApiKey: your_team_api_key_here

        ```

````