---
title: "Create redirect rule"
method: POST
path: "/v1/redirect_rules"
tags: ["Redirect rules"]
---

# Create redirect rule

`POST /v1/redirect_rules`

## Request

- Base URL: `https://ac.cnstrc.com`
- URL: `https://ac.cnstrc.com/v1/redirect_rules`
- Auth: one of:
  - HTTP basic
  - HTTP bearer

**🔐 This endpoint requires [HTTP authentication](https://docs.constructor.com/reference/main-authentication) (either [Basic](https://docs.constructor.com/reference/main-authentication#basic-authentication) or [Bearer](https://docs.constructor.com/reference/main-authentication#bearer-authentication)).**
For authenticating with Bearer token, required scopes are: `redirects(w)`.

Create a redirect rule

## Query parameters

- `key` string, required: The key of the index to use.
- `c` string: The ID of the client and version that the request is coming from, such as `cio-js-2.90`.

## Request body

- RedirectRuleListPostBody
  - `url` string, required: The target URL for the redirect rule.
  - `matches` RedirectRuleMatchRequest[], required: A list of redirect rule matches.
    - `pattern` string, required: The pattern for the redirect rule match.
    - `match_type` 'EXACT' | 'PHRASE' | 'UNORDERED', required: The match type for the redirect rule.
  - `start_time` string, date-time: The start time for the redirect rule.
  - `end_time` string, date-time: The end time for redirect rule.
  - `user_segments` string[]: A list of user segments for the redirect rule.
  - `metadata` object: The metadata for the redirect rule.

## Response `201`

Created

- RedirectRuleListPostResponse
  - `id` integer, required: The identifier for the redirect rule match.
  - `start_time` string, date-time: The start time for the redirect rule.
  - `end_time` string, date-time: The end time for the redirect rule.
  - `url` string, required: The target URL for redirect the rule.
  - `metadata` object: The metadata for the redirect rule.
  - `last_updated` string, date-time: The last updated time for the redirect rule.
  - `user_segments` string[]: A list of user segments for the redirect rule.
  - `matches` RedirectRuleMatchResponse[], required: A list of redirect rule matches.
    - `pattern` string, required: The pattern for the redirect rule match.
    - `match_type` 'EXACT' | 'PHRASE' | 'UNORDERED', required: The match type for the redirect rule.
    - `id` integer, required: The identifier for the redirect rule match.

## Other responses

- `400`: Validation Error
- `401`: Credentials are not passed or action is forbidden.
- `403`: The supplied token does not have the required permissions.
- `429`: Rate limit breached

---

[API](https://skmtc.dev/constructor/apis/configuration.md) - [All operations](https://skmtc.dev/constructor/apis/configuration/llms.txt) - [OpenAPI document](https://skmtc.dev/constructor/apis/configuration/revisions/205ffdb5f494?raw)
