5.3 域名接口
5.3 域名接口
所有接口前缀 /api/v1/domains,均需认证。
创建域名
POST /api/v1/domains
Content-Type: application/json
{
"host": "s.example.com",
"protocol": "https",
"icp_number": "京ICP备 2025xxxx号",
"police_number": "",
"pass_query": true
}
字段说明:
| 字段 | 说明 |
|---|---|
host |
域名主机名,不含协议 |
protocol |
http / https |
icp_number |
ICP 备案号 |
police_number |
公安备案号 |
pass_query |
跳转时是否透传原始查询参数 |
列表
GET /api/v1/domains?page=1&page_size=20
获取活跃域名(无分页)
GET /api/v1/domains/active
返回所有 status=active 的域名,适合前端创建短链接时的下拉选择。
更新
PUT /api/v1/domains/{id}
字段与创建接口相同,均可选。
启停
PUT /api/v1/domains/{id}/status
Content-Type: application/json
{ "status": "inactive" }
删除
DELETE /api/v1/domains/{id}
⚠️ 删除前请确认该域名下没有仍需对外服务的短链接,避免用户访问失败。