**版本：202201**

# 更新 URL 重定向

**PUT** `/openapi/2022-01/redirects/:id`

通过 URL 重定向规则 ID 更新指定 URL 重定向规则的详情。

## 请求

**Path参数**

- `id` string (required)

  URL 重定向规则 ID。

**application/json**

**请求体 | 示例**

**请求体**

- `from_url` string (required)

  Original URL, for example: `/collections/hot-selling`
- `redirect_url` string (required)

  Redirected URL, for example: `/collections/test1567`
- `status` string (required)

  The status of the redirect:
  - `open`: available
  - `close`: unavailable

```json
{
  "from_url": "string",
  "redirect_url": "string",
  "status": "string"
}
```

## 响应

**200 | 404 | 422**

200

**application/json**

无 Schema

404

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "Data not found"
  ]
}
```

```json
{
  "errors": [
    "Data not found"
  ]
}
```

422

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "Target is invalid"
  ]
}
```

```json
{
  "errors": [
    "Target is invalid"
  ]
}
```
