---
title: "Add Redirect rule"
method: POST
path: "/api/sites/multiscreen/site/{site_name}/urlrules"
tags: ["Url Rules"]
---

# Add Redirect rule

`POST /api/sites/multiscreen/site/{site_name}/urlrules`

## Request

- Base URL: `https://api.duda.co`
- URL: `https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules`
- Auth: HTTP basic

Creates a URL rule on a site.

## Path parameters

- `site_name` string, required

## Request body

- RedirectRuleRequest
  - `response_code` integer: Http response status code Supported values: - 301 (Moved Permanently) - 302 (Found) If not specified, defaults to 301
  - `source` string, required: Source path of the redirect Specified page must not exist on site and not be blank. Source page acts as secondary identifier: you can’t have two redirects with same source page
  - `target` string, required: Target path of the redirect. Should correspond to an existing page on the site or an external url If external url is provided, must start with “http/https” External domain is not validated

## Response `201`

Redirect rule created

- RedirectRuleResponse
  - `id` string: Identifier of redirect rule for referencing single object
  - `response_code` integer: Http response status code
  - `source` string: Source path of the redirect
  - `target` string: Target path of the redirect

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `405`: Method Not Allowed
- `429`: Too many requests. The rate limit was exceeded.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/duda/apis/duda-partner-api.md) - [All operations](https://skmtc.dev/duda/apis/duda-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/duda/apis/duda-partner-api/revisions/52be4d41cb12?raw)
