---
updatedAt: 2026-05-28T22:55:55.000Z
agentTools:
  projectIndex: https://docs.constructor.com/llms.txt
---

# Update redirect rule

**🔐 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)`.

Update a redirect rule

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "contact": {
      "email": "support@constructor.io"
    },
    "title": "Configuration",
    "version": "0.1"
  },
  "servers": [
    {
      "url": "https://ac.cnstrc.com"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Redirect rules"
    }
  ],
  "paths": {
    "/v1/redirect_rules/{redirect_rule_id}": {
      "patch": {
        "tags": [
          "Redirect rules"
        ],
        "operationId": "v1-redirects-update-redirect-rule",
        "summary": "Update redirect rule",
        "description": "**🔐 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)).**\nFor authenticating with Bearer token, required scopes are: `redirects(w)`.\n\nUpdate a redirect rule",
        "parameters": [
          {
            "name": "redirect_rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "key",
            "in": "query",
            "schema": {
              "title": "Key",
              "description": "The key of the index to use.",
              "maxLength": 100,
              "minLength": 1,
              "examples": [
                "key_K2pX7vBnU0bgA5xp"
              ],
              "type": "string"
            },
            "required": true
          },
          {
            "name": "c",
            "in": "query",
            "schema": {
              "title": "C",
              "description": "The ID of the client and version that the request is coming from, such as `cio-js-2.90`.",
              "maxLength": 100,
              "minLength": 1,
              "examples": [
                "cio-js-2.90",
                "cio-ios-1.0"
              ],
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedirectRulePatchBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedirectRulePatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation Error"
          },
          "401": {
            "description": "Credentials are not passed or action is forbidden."
          },
          "403": {
            "description": "The supplied token does not have the required permissions."
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Rate limit breached"
          }
        },
        "security": [
          {
            "http_basic_auth": []
          },
          {
            "http_bearer_auth": [
              "redirects(w)"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "RedirectRuleMatchResponse": {
        "title": "RedirectRuleMatchResponse",
        "type": "object",
        "properties": {
          "pattern": {
            "title": "Pattern",
            "description": "The pattern for the redirect rule match.",
            "examples": [
              "take me here",
              "summer sale"
            ],
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "match_type": {
            "title": "Match Type",
            "description": "The match type for the redirect rule.",
            "examples": [
              "EXACT",
              "PHRASE",
              "UNORDERED"
            ],
            "enum": [
              "EXACT",
              "PHRASE",
              "UNORDERED"
            ],
            "type": "string"
          },
          "id": {
            "title": "Id",
            "description": "The identifier for the redirect rule match.",
            "type": "integer"
          }
        },
        "required": [
          "pattern",
          "match_type",
          "id"
        ],
        "additionalProperties": false
      },
      "RedirectRuleMatchRequest": {
        "title": "RedirectRuleMatchRequest",
        "type": "object",
        "properties": {
          "pattern": {
            "title": "Pattern",
            "description": "The pattern for the redirect rule match.",
            "examples": [
              "take me here",
              "summer sale"
            ],
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "match_type": {
            "title": "Match Type",
            "description": "The match type for the redirect rule.",
            "examples": [
              "EXACT",
              "PHRASE",
              "UNORDERED"
            ],
            "enum": [
              "EXACT",
              "PHRASE",
              "UNORDERED"
            ],
            "type": "string"
          }
        },
        "required": [
          "pattern",
          "match_type"
        ],
        "additionalProperties": false
      },
      "RedirectRulePatchBody": {
        "title": "RedirectRulePatchBody",
        "type": "object",
        "properties": {
          "url": {
            "title": "Url",
            "description": "The target URL for the redirect rule.",
            "examples": [
              "/landing-page",
              "/promotions/summer-sale"
            ],
            "minLength": 1,
            "maxLength": 1000,
            "type": "string"
          },
          "matches": {
            "title": "Matches",
            "description": "A list of redirect rule matches.",
            "minItems": 1,
            "maxItems": 300,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RedirectRuleMatchRequest"
            }
          },
          "start_time": {
            "title": "Start Time",
            "description": "The start time for the redirect rule.",
            "examples": [
              "2025-01-01T00:00:00"
            ],
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "title": "End Time",
            "description": "The end time for redirect rule.",
            "examples": [
              "2025-12-31T23:59:59"
            ],
            "type": "string",
            "format": "date-time"
          },
          "user_segments": {
            "title": "User Segments",
            "description": "A list of user segments for the redirect rule.",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "examples": [
                "premium",
                "vip"
              ]
            }
          },
          "metadata": {
            "title": "Metadata",
            "description": "The metadata for the redirect rule.",
            "examples": [
              {
                "campaign": "summer"
              }
            ],
            "type": "object"
          }
        },
        "additionalProperties": false
      },
      "RedirectRulePatchResponse": {
        "title": "RedirectRulePatchResponse",
        "type": "object",
        "properties": {
          "id": {
            "title": "Id",
            "description": "The identifier for the redirect rule match.",
            "type": "integer"
          },
          "start_time": {
            "title": "Start Time",
            "description": "The start time for the redirect rule.",
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "title": "End Time",
            "description": "The end time for the redirect rule.",
            "type": "string",
            "format": "date-time"
          },
          "url": {
            "title": "Target Url",
            "description": "The target URL for redirect the rule.",
            "type": "string"
          },
          "metadata": {
            "title": "Metadata Json",
            "description": "The metadata for the redirect rule.",
            "type": "object"
          },
          "last_updated": {
            "title": "Last Updated",
            "description": "The last updated time for the redirect rule.",
            "type": "string",
            "format": "date-time"
          },
          "user_segments": {
            "title": "User Segments",
            "description": "A list of user segments for the redirect rule.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "matches": {
            "title": "Matches Dicts",
            "description": "A list of redirect rule matches.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RedirectRuleMatchResponse"
            }
          }
        },
        "required": [
          "id",
          "url",
          "matches"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "http_basic_auth": {
        "type": "http",
        "scheme": "basic"
      },
      "http_bearer_auth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": false
  }
}
```