Update redirect by ID

Update a redirect by ID

Updates an existing redirect rule.

Requires authentication.

Request

PUT /redirects/{id}

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe ID of the redirect rule to update.

Headers

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
sourcestringNoSource path to redirect from. Must start with /.
targetstringNoTarget path to redirect to. Must start with /.
codeintegerNoHTTP redirect status code (e.g. 301, 302).
priorityintegerNoPriority used when multiple redirects match.

Example Request

{
  "target": "/updated-page",
  "code": 302
}

Response

Returns the updated redirect object.

Example Response

{
  "id": 42,
  "source": "/old-page",
  "target": "/updated-page",
  "code": 302,
  "priority": 0
}
Path Params
string
required
Body Params
string

The relative source path of the redirect starting with /.

integer

The http code type of the redirect (e.g. 301, 302).

string

The relative target link for the redirect starting with /.

integer

Priority of this redirect if more than one redirect matches.

Headers
string
required

Makaira Instance ID

Response
200

OK

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!