Skip to main content
GET
/
api
/
v1
/
page-builder
/
redirects
curl -X GET "https://your-domain.com/api/v1/page-builder/redirects?active=true&pageSize=10" \
  -H "Authorization: Bearer sk_live_1234567890abcdef" \
  -H "Content-Type: application/json"
{
  "data": [
    {
      "id": "redirect_1234567890abcdef",
      "fromPath": "/old-about",
      "toPath": "/about",
      "type": "permanent",
      "isActive": true,
      "createdAt": "2024-01-05T10:00:00Z",
      "updatedAt": "2024-01-05T10:00:00Z"
    },
    {
      "id": "redirect_0987654321fedcba",
      "fromPath": "/blog/old-post",
      "toPath": "/blog/new-post",
      "type": "permanent",
      "isActive": true,
      "createdAt": "2024-01-08T14:30:00Z",
      "updatedAt": "2024-01-10T09:15:00Z"
    },
    {
      "id": "redirect_abcdef1234567890",
      "fromPath": "/temp-landing",
      "toPath": "/products",
      "type": "temporary",
      "isActive": true,
      "createdAt": "2024-01-12T11:45:00Z",
      "updatedAt": "2024-01-12T11:45:00Z"
    }
  ],
  "meta": {
    "total": 3,
    "page": 1,
    "pageSize": 20,
    "totalPages": 1
  }
}

Overview

This endpoint returns all URL redirects configured in your SitePlot instance with pagination support. You can filter results to show only active redirects and control the number of results per page.

Authentication

Authorization
string
required
Bearer token with your API key: Bearer YOUR_API_KEY

Query Parameters

page
integer
default:"1"
Page number for pagination. Must be 1 or greater.
pageSize
integer
default:"20"
Number of items per page. Must be between 1 and 100.
active
boolean
If set to true, returns only active redirects. If omitted, returns all redirects regardless of status.

Response

data
array
Array of redirect objects
meta
object
Pagination metadata
curl -X GET "https://your-domain.com/api/v1/page-builder/redirects?active=true&pageSize=10" \
  -H "Authorization: Bearer sk_live_1234567890abcdef" \
  -H "Content-Type: application/json"
{
  "data": [
    {
      "id": "redirect_1234567890abcdef",
      "fromPath": "/old-about",
      "toPath": "/about",
      "type": "permanent",
      "isActive": true,
      "createdAt": "2024-01-05T10:00:00Z",
      "updatedAt": "2024-01-05T10:00:00Z"
    },
    {
      "id": "redirect_0987654321fedcba",
      "fromPath": "/blog/old-post",
      "toPath": "/blog/new-post",
      "type": "permanent",
      "isActive": true,
      "createdAt": "2024-01-08T14:30:00Z",
      "updatedAt": "2024-01-10T09:15:00Z"
    },
    {
      "id": "redirect_abcdef1234567890",
      "fromPath": "/temp-landing",
      "toPath": "/products",
      "type": "temporary",
      "isActive": true,
      "createdAt": "2024-01-12T11:45:00Z",
      "updatedAt": "2024-01-12T11:45:00Z"
    }
  ],
  "meta": {
    "total": 3,
    "page": 1,
    "pageSize": 20,
    "totalPages": 1
  }
}

Error Responses

{
  "error": "invalid_api_key",
  "message": "The provided API key is invalid or has been revoked"
}

Redirect Types

The type field indicates the HTTP status code used for the redirect:
TypeHTTP StatusDescriptionUse Case
permanent301Permanent redirectPage has moved permanently, SEO value transfers
temporary302Temporary redirectPage temporarily moved, SEO value retained at original URL

Use Cases

SEO Management

Monitor and manage URL redirects to maintain search engine rankings when restructuring your site. Ensure old links continue to work by setting up appropriate redirects to new page locations.

Campaign Tracking

Create temporary redirects for marketing campaigns and track their performance.

Site Migration

Manage redirects during site migrations to ensure users and search engines find your content.

Path Matching

Exact Path Matching

Redirects match the exact path specified in fromPath:
  • /old-page matches only /old-page
  • Does not match /old-page/ or /old-page/subpage

Query Parameters

Query parameters are preserved during redirects:
  • Request to /old-page?utm_source=email
  • Redirects to /new-page?utm_source=email

Best Practices

Permanent vs Temporary Redirects

  • Use permanent (301) redirects when content has moved permanently
  • Use temporary (302) redirects for short-term changes or A/B testing

Redirect Chains

Avoid creating redirect chains (A → B → C). Instead, redirect directly to the final destination (A → C).

Performance Considerations

  • Too many redirects can impact site performance
  • Regularly audit and clean up unnecessary redirects
  • Monitor redirect response times

Filtering Examples

Get Only Active Redirects

GET /api/v1/page-builder/redirects?active=true

Get All Redirects (Including Inactive)

GET /api/v1/page-builder/redirects

Paginate Through Large Redirect Lists

GET /api/v1/page-builder/redirects?page=2&pageSize=50
  • List Pages - View all pages that redirects might point to