# Verify a custom domain POST https://api2.freecustom.email/v1/custom-domains/{domain}/verify Triggers a live DNS check for the domain's MX and TXT records. Call this after you have added the two records at your registrar. **DNS records required:** | Type | Host | Value | Priority | |------|------|-------|----------| | MX | @ | `mx.freecustom.email` | 10 | | TXT | @ | `freecustomemail-verification=` | — | The `` is the value returned in `txt_record` when you added the domain. It is unique per domain + account. DNS propagation can take up to 48 hours. If verification fails, wait a few minutes and retry — the response includes the specific record that is missing. Once verified, you can immediately register inboxes at `@{domain}` via `POST /v1/inboxes`. **Plan required:** Growth ($49/mo) or Enterprise ($149/mo). Reference: https://docs.freecustom.email/free-custom-email-api/v-1/custom-domains/domain/verify/verify-a-custom-domain ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /v1/custom-domains/{domain}/verify: post: operationId: verify-a-custom-domain summary: Verify a custom domain description: | Triggers a live DNS check for the domain's MX and TXT records. Call this after you have added the two records at your registrar. **DNS records required:** | Type | Host | Value | Priority | |------|------|-------|----------| | MX | @ | `mx.freecustom.email` | 10 | | TXT | @ | `freecustomemail-verification=` | — | The `` is the value returned in `txt_record` when you added the domain. It is unique per domain + account. DNS propagation can take up to 48 hours. If verification fails, wait a few minutes and retry — the response includes the specific record that is missing. Once verified, you can immediately register inboxes at `@{domain}` via `POST /v1/inboxes`. **Plan required:** Growth ($49/mo) or Enterprise ($149/mo). tags: - >- subpackage_v1.subpackage_v1/customDomains.subpackage_v1/customDomains/domain.subpackage_v1/customDomains/domain/verify parameters: - name: domain in: path description: The bare domain name to verify (e.g. `mail.acme.com`). required: true schema: type: string - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: >- #/components/schemas/v1_custom-domains_{domain}_verify_Verify a custom domain_Response_200 '401': description: Unauthorized content: application/json: schema: $ref: >- #/components/schemas/PostV1Custom-domainsDomainVerifyRequestUnauthorizedError '403': description: Forbidden content: application/json: schema: $ref: >- #/components/schemas/PostV1Custom-domainsDomainVerifyRequestForbiddenError '404': description: Not Found content: application/json: schema: $ref: >- #/components/schemas/PostV1Custom-domainsDomainVerifyRequestNotFoundError '422': description: Unprocessable Entity (WebDAV) (RFC 4918) content: application/json: schema: $ref: >- #/components/schemas/PostV1Custom-domainsDomainVerifyRequestUnprocessableEntityError '429': description: Too Many Requests content: application/json: schema: $ref: >- #/components/schemas/PostV1Custom-domainsDomainVerifyRequestTooManyRequestsError servers: - url: https://api2.freecustom.email components: schemas: V1CustomDomainsDomainVerifyPostResponsesContentApplicationJsonSchemaData: type: object properties: domain: type: string verified: type: boolean mx_record: type: string txt_record: type: string required: - domain - verified - mx_record - txt_record title: V1CustomDomainsDomainVerifyPostResponsesContentApplicationJsonSchemaData v1_custom-domains_{domain}_verify_Verify a custom domain_Response_200: type: object properties: success: type: boolean verified: type: boolean message: type: string data: $ref: >- #/components/schemas/V1CustomDomainsDomainVerifyPostResponsesContentApplicationJsonSchemaData required: - success - verified - message - data title: v1_custom-domains_{domain}_verify_Verify a custom domain_Response_200 PostV1Custom-domainsDomainVerifyRequestUnauthorizedError: type: object properties: success: type: boolean error: type: string message: type: string required: - success - error - message title: PostV1Custom-domainsDomainVerifyRequestUnauthorizedError PostV1Custom-domainsDomainVerifyRequestForbiddenError: type: object properties: success: type: boolean error: type: string message: type: string upgrade_url: type: string format: uri required: - success - error - message - upgrade_url title: PostV1Custom-domainsDomainVerifyRequestForbiddenError PostV1Custom-domainsDomainVerifyRequestNotFoundError: type: object properties: success: type: boolean error: type: string message: type: string required: - success - error - message title: PostV1Custom-domainsDomainVerifyRequestNotFoundError V1CustomDomainsDomainVerifyPostResponsesContentApplicationJsonSchemaDnsRecordsNeededItems: type: object properties: type: type: string hostname: type: string value: type: string priority: type: string required: - type - hostname - value - priority title: >- V1CustomDomainsDomainVerifyPostResponsesContentApplicationJsonSchemaDnsRecordsNeededItems PostV1Custom-domainsDomainVerifyRequestUnprocessableEntityError: type: object properties: success: type: boolean verified: type: boolean error: type: string message: type: string hint: type: string dns_records_needed: type: array items: $ref: >- #/components/schemas/V1CustomDomainsDomainVerifyPostResponsesContentApplicationJsonSchemaDnsRecordsNeededItems required: - success - verified - error - message - hint - dns_records_needed title: PostV1Custom-domainsDomainVerifyRequestUnprocessableEntityError PostV1Custom-domainsDomainVerifyRequestTooManyRequestsError: type: object properties: success: type: boolean error: type: string message: type: string upgrade_url: type: string format: uri credits_url: type: string format: uri hint: type: string required: - success - error - message - upgrade_url - credits_url - hint title: PostV1Custom-domainsDomainVerifyRequestTooManyRequestsError securitySchemes: bearerAuth: type: http scheme: bearer ``` ## SDK Code Examples ```python v1_custom-domains_{domain}_verify_Verify a custom domain_example import requests url = "https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript v1_custom-domains_{domain}_verify_Verify a custom domain_example const url = 'https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go v1_custom-domains_{domain}_verify_Verify a custom domain_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby v1_custom-domains_{domain}_verify_Verify a custom domain_example require 'uri' require 'net/http' url = URI("https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java v1_custom-domains_{domain}_verify_Verify a custom domain_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify") .header("Authorization", "Bearer ") .asString(); ``` ```php v1_custom-domains_{domain}_verify_Verify a custom domain_example request('POST', 'https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp v1_custom-domains_{domain}_verify_Verify a custom domain_example using RestSharp; var client = new RestClient("https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift v1_custom-domains_{domain}_verify_Verify a custom domain_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api2.freecustom.email/v1/custom-domains/mail.acme.com/verify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```