---
title: Adding and Verifying Domains
description: Learn how to add and verify a new domain using WP Engine's Hosting Platform API.
url: https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/
image: https://developers.wpengine.com/og/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains.png
---

# Adding and Verifying Domains

This guide explains how to add and verify a domain for your environment using the WP Engine Hosting API. To ensure platform security, all root domains must be verified via a DNS TXT record before traffic can be routed to your site.

## Steps

### 1. Adding the domain to your environment

Use the [Add Domain](https://developers.wpengine.com/docs/managed-hosting-platform/api/reference/operations/createdomain/) endpoint to add the domain to your environment.

Example request:

- [cURL](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-0-0)
- [Go](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-0-1)
- [JavaScript](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-0-2)
- [Python](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-0-3)

Add Domain

```bash
# Replace 12345 with your install ID
curl -X POST "https://api.wpengineapi.com/v1/installs/12345/domains" \
  -u "$WPE_API_USER_ID:$WPE_API_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "example.com",
    "primary": false
  }'
```

Example response:

```json
{
  "id": "e41fa98f-ea80-4654-b229-a9b765d0863a",
  "name": "example.com",
  "primary": false,
  "duplicate": false,
  "secure_all_urls": false,
  "ownership_status": "TXT_VERIFICATION_PENDING",
  "txt_verification_key": "_wpe-verification",
  "txt_verification_value": "abc123def456ghi789jkl012",
  "txt_verified_time": null,
  "txt_verified_domain": null,
  "network_type": "AN",
  "network_details": {
    "dns_config_info": {
      "cname": "example.wpengine.com",
      "a_records": ["192.0.2.1"]
    },
    "network_info": {
      "status": "ACTIVE",
      "ssl": {
        "status": "pending"
      }
    }
  },
  "redirects_to": []
}
```

Key fields in the response for DNS configuration and verification:

- **`txt_verification_key`**: The “name” or “host” for your TXT record.
- **`txt_verification_value`**: The “value” or “content” for your TXT record.
- **`network_details.dns_config_info.cname`**: The CNAME target for your domain.
- **`network_details.dns_config_info.a_records`**: Array of IP addresses for A records.
- **`ownership_status`**: This will initially return `TXT_VERIFICATION_PENDING`.

### 2. Update your DNS records

At your domain registrar (e.g., GoDaddy, Namecheap, etc.), add the records provided in the previous step:

- **TXT Record**: Add a TXT record using the `txt_verification_key` for the **Host/Name** field and the `txt_verification_value` for the **Value** field.
- **Routing Record**: Add your **CNAME** (from `network_details.dns_config_info.cname`) or **A record** (from `network_details.dns_config_info.a_records`) as provided in the API response.

> **Note**
>
> TXT verification is only required for root domains. Sub-domains do not require separate verification once the root domain is verified.

### 3. Trigger the verification check

Once the DNS records are saved, you must manually instruct WP Engine to look for them and move the domain out of the “unverified” state.

Use the [Verify Domain TXT Record](https://developers.wpengine.com/docs/managed-hosting-platform/api/reference/operations/verifydomaintxtrecord/) endpoint to trigger this check.

Example request:

- [cURL](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-1-0)
- [Go](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-1-1)
- [JavaScript](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-1-2)
- [Python](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-1-3)

Trigger Verification

```bash
# Replace 12345 with your install ID and the UUID with your domain ID
curl -X POST "https://api.wpengineapi.com/v1/installs/12345/domains/e41fa98f-ea80-4654-b229-a9b765d0863a/verification" \
  -u "$WPE_API_USER_ID:$WPE_API_PASSWORD"
```

Example response:

```json
{
  "id": "e41fa98f-ea80-4654-b229-a9b765d0863a",
  "name": "example.com",
  "txt_verification_key": "_wpe-verification",
  "txt_verification_value": "abc123def456ghi789jkl012",
  "txt_verified_time": "2026-05-06T12:05:00.007Z",
  "txt_verified_domain": "example.com"
}
```

### 4. Verify the activation status

The verification process typically completes within a few minutes. To confirm the domain is ready, use the [Get Domain](https://developers.wpengine.com/docs/managed-hosting-platform/api/reference/operations/getdomain/) endpoint and check for the following values:

Example request:

- [cURL](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-2-0)
- [Go](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-2-1)
- [JavaScript](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-2-2)
- [Python](https://developers.wpengine.com/docs/managed-hosting-platform/api/guides/adding-and-verifying-domains/#tab-panel-2-3)

Get Domain

```bash
# Replace 12345 with your install ID and the UUID with your domain ID
curl -X GET "https://api.wpengineapi.com/v1/installs/12345/domains/e41fa98f-ea80-4654-b229-a9b765d0863a" \
  -u "$WPE_API_USER_ID:$WPE_API_PASSWORD"
```

Example response when verification is complete:

```json
{
  "id": "e41fa98f-ea80-4654-b229-a9b765d0863a",
  "name": "example.com",
  "primary": false,
  "duplicate": false,
  "secure_all_urls": false,
  "ownership_status": "TXT_VERIFIED",
  "txt_verification_key": null,
  "txt_verification_value": null,
  "txt_verified_time": "2026-05-06T12:05:00.007Z",
  "txt_verified_domain": "example.com",
  "network_type": "AN",
  "network_details": {
    "dns_config_info": {
      "cname": "example.wpengine.com",
      "a_records": ["192.0.2.1"]
    },
    "network_info": {
      "status": "ACTIVE",
      "ssl": {
        "status": "active"
      }
    }
  },
  "redirects_to": []
}
```

Key fields to check:

- **`ownership_status`**: Should now return `TXT_VERIFIED`.
- **`txt_verified_time`**: Indicates the exact timestamp the verification handshake was completed.
- **`txt_verified_domain`**: Confirms the specific domain successfully verified by the system.
- **`txt_verification_key`** and **`txt_verification_value`**: Will be `null` once verified.

Once verified, traffic will begin routing automatically. If this domain was designated as the **Primary Domain**, that change will now take effect.

> **Tip**
>
> If you need to retrieve your verification keys or check your DNS targets at a later time, you can call the [Get Domain](https://developers.wpengine.com/docs/managed-hosting-platform/api/reference/operations/getdomain/) endpoint or visit the Domains page in the WP Engine User Portal.

## Was this helpful?

Thanks for the feedback!

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://developers.wpengine.com/#website","name":"WP Engine Product Documentation","url":"https://developers.wpengine.com/","description":"Resources for developing, deploying, and scaling on WP Engine.","inLanguage":"en-US","keywords":["API documentation","product documentation","headless WordPress","managed WordPress hosting"],"publisher":{"@id":"https://wpengine.com/#organization"}}]}
```
