> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/zga/accelerator/modifyacceleratordomain.md). Agents can also search and read this documentation through its [MCP server](https://docs.console.zenlayer.com/api-reference/~gitbook/mcp).

# ModifyAcceleratorDomain

## 1. API Description

This API (ModifyAcceleratorDomain) is used to modify an accelerator's acceleration domain.

{% hint style="info" %}
**Notes**

* Domain cannot be the same as origin, otherwise it will form a loop and become inaccessible.
* Domain is globally unique, and accelerators cannot be configured with the same domain.
* When only modifying the primary domain or related domains, you need to submit the entire domain configuration. It is recommended to call `DescribeAccelerators` API before modification to obtain the primary domain and related domain configuration.
* This is an asynchronous API. After the API returns successfully, the accelerator modification operation is not immediately completed. During this period, the accelerator status will be `Deploying`. You can query the accelerator status by calling the `DescribeAccelerators` API. If the accelerator status (acceleratorStatus) changes from `Deploying` to `Accelerating`, it indicates successful acceleration. `AccelerateFailure` indicates acceleration failure, and you can call the redeploy API to retry.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API Input Parameters.

| Parameter Name | Required | Type                                                                                  | Description                                                                                                                                        |
| -------------- | -------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| acceleratorId  | Yes      | String                                                                                | Accelerator ID                                                                                                                                     |
| domain         | Yes      | [Domain](https://docs.console.zenlayer.com/api-reference/zga/datastructure.md#domain) | <p>Domain is globally unique, duplicate domains are not allowed</p><p>Domain cannot be the same as the origin address, which will cause a loop</p> |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |

## 4. Code Examples

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

1. **Modify accelerator domain**

```json
POST /api/v2/zga HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyAcceleratorDomain
<Common Request Params>

Request:
{
    "acceleratorId": "acceleratorIdxxxxx",
     "domain": {
        "domain": "xx.xx.com",
        "relateDomains": "xx.xx.cn"
    }
}


Response:
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                              | Description                                          |
| ---------------- | --------------------------------------- | ---------------------------------------------------- |
| 400              | DOMAIN\_SAME\_AS\_ORIGIN                | Domain cannot be the same as origin                  |
| 400              | ACCELERATOR\_DOMAIN\_EXIST              | Domain already exists                                |
| 400              | NOT\_SUPPORT\_RELATE\_DOMAINS           | IP acceleration does not support related domains     |
| 400              | RELATE\_DOMAINS\_EXCEED\_LIMIT          | Related domain configuration exceeds limit           |
| 400              | RELATE\_DOMAINS\_CONFLICT\_WITH\_DOMAIN | Related domains conflict with domain                 |
| 400              | NOT\_SUPPORT\_MODIFY\_DOMAIN            | IP acceleration does not support domain modification |
