# Domain configuration

## Add a domain to a store

POST `/stores/{store_id}/domains`

This endpoint lets you add a domain to a store.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Request body**

```json
{
    "domain": "domain-test.com"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Domain added successfully",
    "data": {
        "domain": "domain-test.com",
        "projectId": "v0-nike-shoe-store-creation-d-fu-c-wz-oq-r-kg",
        "domainResponse": {
            "name": "domain-test.com",
            "apexName": "domain-test.com",
            "projectId": "prj_1xANFUDu3UwHyjYcUtJEjLwPaM2e",
            "redirect": null,
            "redirectStatusCode": null,
            "gitBranch": null,
            "customEnvironmentId": null,
            "updatedAt": 1764319805070,
            "createdAt": 1764319805070,
            "verified": false,
            "verification": [
                {
                    "type": "TXT",
                    "domain": "_vercel.domain-test.com",
                    "value": "vc-domain-verify=domain-test.com,022db5b86866030c58de",
                    "reason": "pending_domain_verification"
                }
            ]
        },
        "config": {
            "configuredBy": null,
            "acceptedChallenges": [],
            "recommendedIPv4": [
                {
                    "rank": 1,
                    "value": [
                        "216.150.1.1",
                        "216.150.16.1"
                    ]
                },
                {
                    "rank": 2,
                    "value": [
                        "76.76.21.21"
                    ]
                }
            ],
            "recommendedCNAME": [
                {
                    "rank": 1,
                    "value": "7e8e70c7b54787ba.vercel-dns-016.com."
                },
                {
                    "rank": 2,
                    "value": "cname.vercel-dns.com."
                }
            ],
            "misconfigured": true
        }
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "success": false,
    "message": "Deploy your store first."
}
```

{% endtab %}
{% endtabs %}

## Get domain configuration

GETT `/stores/{store_id}/domains/{domain_name}`

This endpoint lets you get a domain configuration.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Domain configs fetched successfully",
    "data": {
        "config": {
            "configuredBy": null,
            "acceptedChallenges": [],
            "recommendedIPv4": [
                {
                    "rank": 1,
                    "value": [
                        "216.150.1.1",
                        "216.150.16.1"
                    ]
                },
                {
                    "rank": 2,
                    "value": [
                        "76.76.21.21"
                    ]
                }
            ],
            "recommendedCNAME": [
                {
                    "rank": 1,
                    "value": "7e8e70c7b54787ba.vercel-dns-016.com."
                },
                {
                    "rank": 2,
                    "value": "cname.vercel-dns.com."
                }
            ],
            "misconfigured": true
        },
        "status": {
            "name": "domain-test.com",
            "apexName": "domain-test.com",
            "projectId": "prj_1xANFUDu3UwHyjYcUtJEjLwPaM2e",
            "redirect": null,
            "redirectStatusCode": null,
            "gitBranch": null,
            "customEnvironmentId": null,
            "updatedAt": 1764319805070,
            "createdAt": 1764319805070,
            "verified": false,
            "verification": [
                {
                    "type": "TXT",
                    "domain": "_vercel.domain-test.com",
                    "value": "vc-domain-verify=domain-test.com,022db5b86866030c58de",
                    "reason": "pending_domain_verification"
                }
            ]
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Delete domain from store

DEL `/stores/{store_id}/domains/{domain_name}`

This endpoint lets you delete a domain from a store.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Domain domain-test.com removed successfully"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.searchagora.com/store-builder/domain-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
