> For the complete documentation index, see [llms.txt](https://docs.tpi.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tpi.dev/guide/api-management/api-modify-batch.md).

# API Modify Batch

<mark style="color:green;">**Path: API Management > API Modify Batch**</mark>

In this section, you can find instructions on how to quickly modify APIs when changing the host environment or port number. This functionality is applicable for red-black deployment or API version updates, and the system supports batch modification of registered APIs.

![](/files/xOrvjbquMeOlf2whwBek)

### Search by Label and Site

In this section, you can find instructions on how to search for APIs by label and by site.

#### **Search by Label**

{% hint style="warning" %}
If searching by label, and the label is applied to a composer API, the response will return empty.
{% endhint %}

1. Click **Search by Label** to display the label list.

![](/files/OSXTdsuG54m7ExHfvyof)

2. Check the desired labels to search for, and click **Confirm**.

<div align="left"><img src="/files/1ew3ZQ2f7fa6eadiWACK" alt="" width="413"></div>

3. APIs matching the specified criteria will be displayed.

![](/files/k1QXL0oQF1fyAF1bnPAs)

#### **Search by Site**

1. Click **Search by Site** to display the site list.

![](/files/bU3ZS2B2K3RErJvTZauN)

2. Check the desired target sites to search for, and click **Confirm**.

<div align="left"><img src="/files/mlGDLvwtNIl6Czu95pd3" alt="" width="411"></div>

3. APIs matching the specified criteria will be displayed.

![](/files/VCWqfrbQBPHxaxcwFZii)

### Enable, Disable, Activate No Auth, and Deactivate No Auth for APIs

1. Check multiple APIs at once, and click **Enable** to enable APIs in batches.

![](/files/WVVMcnkc65HCBmKFvmBl)

2. Check multiple APIs at once, and click **Disable** to disable APIs in batches.

![](/files/55yeq4oSR8GzWegyGv2x)

3. Check multiple APIs at once, and click **Active No Auth** to activate No Auth for APIs in batches.

![](/files/3rkQHpI2imAb2awuduPz)

4. Check multiple APIs at once, and click **Inactive No Auth** to deactivate No Auth for APIs in batches.

![](/files/GB7OazsrOPxLCPpVHiJN)

### Reset label <a href="#toc169186094" id="toc169186094"></a>

{% hint style="danger" %}
**Reset label** clears all existing labels of selected APIs and replaces them with the input ones. If nothing is entered in the input box, the labels will remain empty.
{% endhint %}

1. Check the APIs to modify, and click **Reset label**.

![](/files/ZZWiVGmvVbP7KuPvpE1S)

2. Enter the desired label, press the **Enter** key, and click **Confirm**.

<div align="left"><img src="/files/zG5fZMYQ4BYuaE350Zqc" alt="" width="411"></div>

<div align="left"><img src="/files/LlKIX6lWjp0eBokubZZ9" alt="" width="413"></div>

3. A confirmation prompt displaying the message "**The original label will be cleared, Confirm the reset?**" will pop up. Click **Confirm** to apply the label change.

<div align="left"><img src="/files/7ZaBAAFAN7KyqQMEqm9S" alt="" width="415"></div>

### Reset fail handle policy <a href="#toc169186095" id="toc169186095"></a>

1. Check the APIs to modify, and click **Reset fail handle policy**.

![](/files/KUg2JSTPdc0AA0PwpVQl)

2. Enter the desired **Fail Discovery Policy** or **Fail Handle Policy**, and click **Confirm**.

<div align="left"><img src="/files/fA8kWBSV7rO9XHnuQsd9" alt="" width="411"></div>

3. A confirmation prompt displaying the message "**Confirm reset?**" will pop up. Click **Confirm** to apply the policy change.

<div align="left"><img src="/files/LJvTHwFpIcGDJMLtvrBx" alt="" width="414"></div>

### API URL Setting <a href="#aw1rhkqmw63" id="aw1rhkqmw63"></a>

In this section, you can find instructions on how to modify the string or percentage of the API URL.

#### **Modify Percentage**

1. Check the APIs to modify, and click **API URL Setting**.

<figure><img src="/files/QMJQUMHAwDrpdKYSJMV4" alt=""><figcaption></figcaption></figure>

2. Fill in the desired API URL, check **Percentage**, enter a value, and click **Preview**.

* **Search/Replace Target**<mark style="color:red;">**\***</mark>**:** The URL target or string to be modified.
* **Percentage:** If **Percentage** is checked, modify the percentage of the input item, and set the rest to zero. If the total percentage is not 100 after modification, it will result in **failed**.\
  Calculation of Total Percentage:
  * When there is no routing, the total percentage is the sum of each percentage for that API.
  * When there is routing, the total percentage is the sum based on the IP field for each item.

{% hint style="warning" %}
When **Percentage** is checked, the total percentage must be 100.
{% endhint %}

![](/files/73DWtUrYGRXYePIJs7bJ)

3. Check the results in the Preview page, and upon confirming correctness, click **Confirm** to save and exit.

![](/files/GahKyczat0ioyHrAIc1x)

#### **Replace String**

1. To replace *api.kcg.gov.tw* with *127.0.0.1:8080* as shown in the figure below, check the desired API, and click **API URL Setting**.

<figure><img src="/files/zyYZK8oqQgL7w40YBh43" alt=""><figcaption></figcaption></figure>

2. Fill in the desired API URL, check **Replace String**, enter *127.0.0.1:8080* in the input box, and click **Preview**.

* **Search/Replace Target**<mark style="color:red;">**\***</mark>**:** The URL target or string to be modified.
* **Replace String:** The string to be modified.

<figure><img src="/files/bnwjZzBKJWQAYhrycGap" alt=""><figcaption></figcaption></figure>

3. The system will search for the specified condition and replace it with the string entered by the user. Check the results in the Preview page, and upon confirming correctness, click **Confirm** to save and exit.

<figure><img src="/files/5E26covYlvWWBU3DLdO4" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.tpi.dev/guide/api-management/api-modify-batch.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.
