Basic

Create URL Redirect

Changed on

Create a new URL redirect in your HubSpot account. This endpoint allows you to define the destination URL, redirect style, and route prefix for the redirect. It is useful for managing URL redirections and ensuring that users are directed to the correct pages.

post/cms/url-redirects/2026-09

Request

  • Base URL
    https://api.hubapi.com
  • Auth
    OAuth 2
    Authorization code: https://app.hubspot.com/oauth/authorize
    Token URL: https://api.hubapi.com/oauth/v1/token scopes: content

Request body

destinationstring required

The destination URL, where the target URL should be redirected if it matches the routePrefix.

isMatchFullUrlboolean

Whether the routePrefix should match on the entire URL, including the domain.

isMatchQueryStringboolean

Whether the routePrefix should match on the entire URL path, including the query string.

isOnlyAfterNotFoundboolean

Whether the URL redirect mapping should apply only if a live page on the URL isn't found. If False, the URL redirect mapping will take precedence over any existing page.

isPatternboolean

Whether the routePrefix should match based on pattern.

isProtocolAgnosticboolean

Whether the routePrefix should match both HTTP and HTTPS protocols.

isTrailingSlashOptionalboolean

Whether a trailing slash will be ignored.

precedenceinteger

Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the lower precedence will be used.

redirectStyleinteger required

The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details here.

routePrefixstring required

The target incoming URL, path, or pattern to match for redirection.

Response

successful operation

createdstring date-time required

The date and time when the URL mapping was initially created.

destinationstring required

The destination URL, where the target URL should be redirected if it matches the routePrefix.

idstring required

The unique ID of this URL redirect.

isMatchFullUrlboolean required

Whether the routePrefix should match on the entire URL, including the domain.

isMatchQueryStringboolean required

Whether the routePrefix should match on the entire URL path, including the query string.

isOnlyAfterNotFoundboolean required

Whether the URL redirect mapping should apply only if a live page on the URL isn't found. If False, the URL redirect mapping will take precedence over any existing page.

isPatternboolean required

Whether the routePrefix should match based on pattern.

isProtocolAgnosticboolean required

Whether the routePrefix should match both HTTP and HTTPS protocols.

isTrailingSlashOptionalboolean required

Whether a trailing slash will be ignored.

precedenceinteger required

Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the lower precedence will be used.

redirectStyleinteger required

The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details here.

routePrefixstring required

The target incoming URL, path, or pattern to match for redirection.

updatedstring date-time required

The date and time when the URL mapping was last modified.

Changes

    • info

      api operation id post-/cms/url-redirects/2026-09_/cms/url-redirects/2026-09 removed and replaced with post-/cms/url-redirects/2026-09_/cms/url-redirects/v3

    • info

      the endpoint scheme security private_apps was removed from the API