Test a URL against all redirects

Test a URL against all redirects

Tests a given URL against all configured redirect rules and returns which redirect(s) would match and which one would be applied.

Requires authentication.

Request

POST /redirects/debug

Headers

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
urlstringYesThe URL path to test against all redirect rules.

Example Request

{
  "url": "/old-page"
}

Response

Response Body

FieldTypeDescription
countintegerTotal number of matching redirects.
matchedobjectThe redirect that would be applied (highest priority match). Contains id, target, and code.
redirectsarrayAll matching redirects, including their source, target, code, priority, and id.

Example Response

{
  "count": 1,
  "matched": {
    "id": 42,
    "target": "/new-page",
    "code": 301
  },
  "redirects": [
    {
      "id": 42,
      "source": "/old-page",
      "target": "/new-page",
      "code": 301,
      "priority": 0
    }
  ]
}

No Match

When no redirect matches the given URL:

{
  "count": 0,
  "matched": null,
  "redirects": []
}
Body Params
string

The URL to test.

Headers
string
required

Makaira Instance ID

Responses

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json