---
title: "Create a redirect"
method: POST
path: "/admin/redirects.json"
tags: ["Redirect"]
---

# Create a redirect

`POST /admin/redirects.json`

## Request body

- UpsertRedirectRequestDto
  - `redirect` RedirectRequestDto
    - `from_url` string — The old path to be redirected. When the user visits this path, they will be redirected to the target.
    - `id` integer — The ID for the redirect.
    - `to_url` string — The target location where the user will be redirected. When the user visits the old path specified by the `from_url` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters)

## Response `200`

OK

- RedirectsSwaggerResponse
  - `redirects` Redirect[]
    - `from_url` string — The old path to be redirected. When the user visits this path, they will be redirected to the target.
    - `id` integer — The ID for the redirect.
    - `to_url` string — The target location where the user will be redirected. When the user visits the old path specified by the `from_url` property, they will be redirected to this location. This property can be set to any path on the shop's site, or to an external URL. (maximum: 255 characters)

---

[API](https://skmtc.dev/shopbase/apis/shopbase-internal-api.md) · [All operations](https://skmtc.dev/shopbase/apis/shopbase-internal-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/shopbase/shopbase-internal-api/revisions/353ccde6240d/schema)
