**Version: 202201**

# Create Redirect

**POST** `/openapi/2022-01/redirects`

Create a new url redirect with the provided details.

## Request

**application/json**

**Body | Example**

**Body**

- `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

  **Default value:** `open`

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

## Responses

**200 | 422**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `id` integer

  **Default value:** `0`

  **Example:** `373043233132924740`
- `store_id` integer

  **Default value:** `0`

  **Example:** `633130`
- `status` string

  **Example:** `open`
- `from_url` string

  **Example:** `/collections/hot-selling`
- `redirect_url` string

  **Example:** `/collections/test1567`

```json
{
  "id": 373043233132924740,
  "store_id": 633130,
  "status": "open",
  "from_url": "/collections/hot-selling",
  "redirect_url": "/collections/test1567"
}
```

```json
{
  "id": 373043233132924740,
  "store_id": 633130,
  "status": "open",
  "from_url": "/collections/hot-selling",
  "redirect_url": "/collections/test1567"
}
```

422

**application/json**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "Path has already been take"
  ]
}
```

```json
{
  "errors": [
    "Path has already been take"
  ]
}
```
