---
title: "Update a URL rewrite"
method: PUT
path: "/marketing/url-rewrites/{id}"
tags: ["Admin Marketing: Search & SEO"]
---

# Update a URL rewrite

`PUT /marketing/url-rewrites/{id}`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/marketing/url-rewrites/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/marketing/url-rewrites/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Update a URL rewrite

## Path parameters

- `id` string, required

## Request body

- object
  - `entity_type` 'product' | 'category' | 'cms_page'
  - `request_path` string
  - `target_path` string
  - `redirect_type` '301' | '302'
  - `locale` string

## Response `200`

URL rewrite updated.

## Other responses

- `400`: Invalid input
- `404`: URL rewrite not found.
- `422`: Validation failure.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
