---
title: "设置 IP 白名单（覆盖式）"
method: POST
path: "/v1/ip-whitelist"
tags: ["pro"]
---

# 设置 IP 白名单（覆盖式）

`POST /v1/ip-whitelist`

## Request

- Base URL: `https://api.ashareapi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ashareapi.com/v1/ip-whitelist`
- Auth: none declared

设置当前 Key 的 IP 白名单（**整体替换**旧列表）。

**参数**：`ips` —— IP 列表（最多 50 个，仅支持**精确 IPv4/IPv6**，⛔ 不支持网段）。

⚠️ 传空 = 清空（等价 `DELETE`，但**建议用 DELETE** 表达清除意图）。
⚠️ **换网络时请把新旧 IP 一起传**（如 `1.2.3.4,5.6.7.8`），⛔ 只传新 IP 会让旧 IP 立刻失效。
⚠️ 设置后**只能从名单内的 IP 再调用本端点**。
⚠️ 属 **Unlimited（¥199）** 档能力。

## Query parameters

- `ips` string: 逗号分隔的 IP 列表，如 1.2.3.4,5.6.7.8

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ashareapi/apis/a-api.md) · [All operations](https://skmtc.dev/ashareapi/apis/a-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ashareapi/apis/a-api/revisions/fc57bdcb13d5?raw)
