### Get Domain Verification Key (Shell Curl) Source: https://api.mxroute.com/docs/index This example shows how to retrieve the verification key for a domain using a Shell Curl request. It requires authentication via custom headers (X-Server, X-Username, X-API-Key). ```shell curl -X GET 'https://api.mxroute.com/verification-key' \ -H 'X-Server: YOUR_SECRET_TOKEN' \ -H 'X-Username: YOUR_SECRET_TOKEN' \ -H 'X-API-Key: YOUR_SECRET_TOKEN' ``` -------------------------------- ### GET /domains Source: https://api.mxroute.com/docs/index Retrieves a list of all domains associated with the MXroute account. Requires authentication headers. ```APIDOC ## GET /domains ### Description Returns a list of all domains on the account. ### Method GET ### Endpoint `/domains` ### Parameters #### Query Parameters None #### Headers - **X-Server** (string) - Required - Your mail server hostname - **X-Username** (string) - Required - Your DirectAdmin username - **X-API-Key** (string) - Required - Your API key ### Request Example ```bash curl https://api.mxroute.com/domains \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - A list of domain names (strings). #### Response Example ```json { "success": true, "data": [ "example.com", "mydomain.org" ] } ``` ``` -------------------------------- ### GET /verification-key Source: https://api.mxroute.com/docs/index Retrieve the domain verification key. This is a read-only endpoint used for verifying domain ownership. ```APIDOC ## GET /verification-key ### Description Get domain verification key. ### Method GET ### Endpoint `/verification-key` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **verification_key** (string) - The domain verification key. #### Response Example ```json { "verification_key": "YOUR_VERIFICATION_KEY" } ``` ``` -------------------------------- ### GET /domains/{domain} Source: https://api.mxroute.com/docs/index Retrieves detailed information about a specific domain. Requires the domain name as a path parameter and authentication headers. ```APIDOC ## GET /domains/{domain} ### Description Get domain details. ### Method GET ### Endpoint `/domains/{domain}` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to retrieve details for. #### Query Parameters None #### Headers - **X-Server** (string) - Required - Your mail server hostname - **X-Username** (string) - Required - Your DirectAdmin username - **X-API-Key** (string) - Required - Your API key ### Request Example ```bash curl https://api.mxroute.com/domains/example.com \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains details about the domain. - **domain** (string) - The domain name. - **mail_hosting** (boolean) - Indicates if mail hosting is enabled. - **ssl_enabled** (boolean) - Indicates if SSL is enabled. - **pointers** (array) - A list of pointer records for the domain. #### Response Example ```json { "success": true, "data": { "domain": "example.com", "mail_hosting": true, "ssl_enabled": true, "pointers": [ "string" ] } } ``` ``` -------------------------------- ### Get Domain Details using cURL Source: https://api.mxroute.com/docs/index Fetches detailed information about a specific domain. Requires the domain name as a path parameter and authentication headers. The response includes domain details such as mail hosting status and SSL enablement. ```shell curl https://api.mxroute.com/domains/example.com \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' ``` -------------------------------- ### Authentication Source: https://api.mxroute.com/docs/index All API requests require three HTTP headers for authentication: X-Server, X-Username, and X-API-Key. API keys can be created in the mxpanel dashboard. ```APIDOC ## Authentication All API requests require three HTTP headers: | Header | Description | |-------------|------------------------------------------------| | `X-Server` | Your mail server hostname (e.g., `eagle.mxlogin.com`) | | `X-Username`| Your DirectAdmin username | | `X-API-Key` | Your API key | Create API keys in your mxpanel dashboard. ``` -------------------------------- ### Create Domain using cURL Source: https://api.mxroute.com/docs/index Adds a new domain to the MXroute account. Requires authentication headers and a JSON request body containing the 'domain' name. Returns a 201 status code on success with details of the created domain, or 409 if the domain already exists. ```shell curl https://api.mxroute.com/domains \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' \ --data '{ "domain": "example.com" }' ``` -------------------------------- ### POST /domains Source: https://api.mxroute.com/docs/index Adds a new domain to the MXroute account. Requires domain name in the request body and authentication headers. ```APIDOC ## POST /domains ### Description Add a new domain to the account. ### Method POST ### Endpoint `/domains` ### Parameters #### Query Parameters None #### Headers - **X-Server** (string) - Required - Your mail server hostname - **X-Username** (string) - Required - Your DirectAdmin username - **X-API-Key** (string) - Required - Your API key #### Request Body - **domain** (string) - Required - The domain name to add. ### Request Example ```bash curl https://api.mxroute.com/domains \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' \ --data '{ "domain": "example.com" }' ``` ### Response #### Success Response (201) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains details of the created domain. - **domain** (string) - The name of the created domain. - **ssl_enabled** (boolean) - Indicates if SSL is enabled for the domain. #### Response Example ```json { "success": true, "data": { "domain": "string", "ssl_enabled": true } } ``` ``` -------------------------------- ### List Domains using cURL Source: https://api.mxroute.com/docs/index Retrieves a list of all domains associated with the MXroute account. Requires authentication headers: X-Server, X-Username, and X-API-Key. The response contains a JSON object with a 'success' boolean and a 'data' array of domain names. ```shell curl https://api.mxroute.com/domains \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' ``` -------------------------------- ### Rate Limits Source: https://api.mxroute.com/docs/index The API enforces rate limits for read and write operations to ensure service stability. Response headers provide information about the current rate limit status. ```APIDOC ## Rate Limits | Operation Type | Limit | |----------------|--------------------| | Read (GET) | 100 requests/minute| | Write (POST, PATCH, DELETE) | 20 requests/minute | Rate limit headers are included in every response: * `X-RateLimit-Limit`: Maximum requests allowed * `X-RateLimit-Remaining`: Requests remaining in window * `X-RateLimit-Reset`: Unix timestamp when limit resets ``` -------------------------------- ### Error Responses Source: https://api.mxroute.com/docs/index All errors returned by the API follow a consistent JSON format, including a success flag, error code, and a human-readable message. Optional field information is provided for validation errors. ```APIDOC ## Error Responses All errors follow this format: ```json { "success": false, "error": { "code": "ERROR_CODE", "message": "Human-readable message", "field": "field_name" // Optional, for validation errors } } ``` Common error codes: * `VALIDATION_ERROR` - Invalid input data * `UNAUTHORIZED` - Invalid or missing credentials * `FORBIDDEN` - Insufficient permissions * `NOT_FOUND` - Resource not found * `CONFLICT` - Resource already exists * `BUSINESS_ERROR` - Business logic violation (e.g., limit reached) * `RATE_LIMITED` - Too many requests * `SERVER_ERROR` - Internal server error ``` -------------------------------- ### Enable/Disable Mail Hosting for Domain (Shell Curl) Source: https://api.mxroute.com/docs/index This snippet demonstrates how to enable or disable mail hosting for a specific domain using a Shell Curl request. It requires the domain name and a boolean value for 'enabled' in the JSON body. Authentication is handled via custom headers. ```shell curl 'https://api.mxroute.com/domains/{domain}/mail-status' \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' \ --data '{ "enabled": true }' ``` -------------------------------- ### DELETE /domains/{domain} Source: https://api.mxroute.com/docs/index Removes a domain from the MXroute account. Requires the domain name as a path parameter and authentication headers. ```APIDOC ## DELETE /domains/{domain} ### Description Remove a domain from the account. ### Method DELETE ### Endpoint `/domains/{domain}` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to delete. #### Query Parameters None #### Headers - **X-Server** (string) - Required - Your mail server hostname - **X-Username** (string) - Required - Your DirectAdmin username - **X-API-Key** (string) - Required - Your API key ### Request Example ```bash curl https://api.mxroute.com/domains/example.com \ --request DELETE \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (204) No content is returned on successful deletion. ``` -------------------------------- ### Delete Domain using cURL Source: https://api.mxroute.com/docs/index Removes a domain from the MXroute account. Requires the domain name as a path parameter and authentication headers. A successful deletion returns a 204 No Content status. ```shell curl https://api.mxroute.com/domains/example.com \ --request DELETE \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' ``` -------------------------------- ### PATCH /domains/{domain}/mail-status Source: https://api.mxroute.com/docs/index Enable or disable mail hosting for a specific domain. This endpoint allows you to control the mail hosting status by sending a boolean value in the request body. ```APIDOC ## PATCH /domains/{domain}/mail-status ### Description Enable or disable mail hosting for a domain. ### Method PATCH ### Endpoint `/domains/{domain}/mail-status` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain for which to set the mail hosting status. #### Query Parameters None #### Request Body - **enabled** (boolean) - Required - Whether mail hosting is enabled. ### Request Example ```json { "enabled": true } ``` ### Response #### Success Response (200) - **message** (string) - Status updated #### Response Example ```json { "message": "Status updated" } ``` ``` -------------------------------- ### PATCH /domains/{domain}/mail-status Source: https://api.mxroute.com/docs/index Updates the mail status for a specific domain. Requires the domain name as a path parameter and the new mail status in the request body, along with authentication headers. ```APIDOC ## PATCH /domains/{domain}/mail-status ### Description Updates the mail status for a specific domain. ### Method PATCH ### Endpoint `/domains/{domain}/mail-status` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to update. #### Query Parameters None #### Headers - **X-Server** (string) - Required - Your mail server hostname - **X-Username** (string) - Required - Your DirectAdmin username - **X-API-Key** (string) - Required - Your API key #### Request Body - **mail_status** (boolean) - Required - Set to `true` to enable mail hosting, `false` to disable. ### Request Example ```bash curl https://api.mxroute.com/domains/example.com/mail-status \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'X-Server: YOUR_SECRET_TOKEN' \ --header 'X-Username: YOUR_SECRET_TOKEN' \ --header 'X-API-Key: YOUR_SECRET_TOKEN' \ --data '{ "mail_status": true }' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the updated domain details. - **domain** (string) - The domain name. - **mail_hosting** (boolean) - The updated mail hosting status. - **ssl_enabled** (boolean) - The current SSL status. #### Response Example ```json { "success": true, "data": { "domain": "example.com", "mail_hosting": true, "ssl_enabled": true } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.