curl --request POST \
--url https://api.hubapi.com/cms/url-redirects/2026-03 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": "<string>",
"redirectStyle": 123,
"routePrefix": "<string>",
"isMatchFullUrl": true,
"isMatchQueryString": true,
"isOnlyAfterNotFound": true,
"isPattern": true,
"isProtocolAgnostic": true,
"isTrailingSlashOptional": true,
"precedence": 123
}
'{
"created": "2023-11-07T05:31:56Z",
"destination": "<string>",
"id": "<string>",
"isMatchFullUrl": true,
"isMatchQueryString": true,
"isOnlyAfterNotFound": true,
"isPattern": true,
"isProtocolAgnostic": true,
"isTrailingSlashOptional": true,
"precedence": 123,
"redirectStyle": 123,
"routePrefix": "<string>",
"updated": "2023-11-07T05:31:56Z"
}Create a new URL redirect in your HubSpot account. This endpoint allows you to define a new URL mapping that redirects traffic from a specified route to a destination URL. This is useful for managing URL changes, handling outdated links, or creating short links.
curl --request POST \
--url https://api.hubapi.com/cms/url-redirects/2026-03 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": "<string>",
"redirectStyle": 123,
"routePrefix": "<string>",
"isMatchFullUrl": true,
"isMatchQueryString": true,
"isOnlyAfterNotFound": true,
"isPattern": true,
"isProtocolAgnostic": true,
"isTrailingSlashOptional": true,
"precedence": 123
}
'{
"created": "2023-11-07T05:31:56Z",
"destination": "<string>",
"id": "<string>",
"isMatchFullUrl": true,
"isMatchQueryString": true,
"isOnlyAfterNotFound": true,
"isPattern": true,
"isProtocolAgnostic": true,
"isTrailingSlashOptional": true,
"precedence": 123,
"redirectStyle": 123,
"routePrefix": "<string>",
"updated": "2023-11-07T05:31:56Z"
}Documentation Index
Fetch the complete documentation index at: https://developers.hubspot.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Supported products
Required Scopes
The access token received from the authorization server in the OAuth 2.0 flow.
The destination URL, where the target URL should be redirected if it matches the routePrefix.
The target incoming URL, path, or pattern to match for redirection.
Whether the routePrefix should match on the entire URL, including the domain.
Whether the routePrefix should match on the entire URL path, including the query string.
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.
Whether the routePrefix should match based on pattern.
Whether the routePrefix should match both HTTP and HTTPS protocols.
Whether a trailing slash will be ignored.
Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the lower precedence will be used.
successful operation
The date and time when the URL mapping was initially created.
The destination URL, where the target URL should be redirected if it matches the routePrefix.
The unique ID of this URL redirect.
Whether the routePrefix should match on the entire URL, including the domain.
Whether the routePrefix should match on the entire URL path, including the query string.
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.
Whether the routePrefix should match based on pattern.
Whether the routePrefix should match both HTTP and HTTPS protocols.
Whether a trailing slash will be ignored.
Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the lower precedence will be used.
The target incoming URL, path, or pattern to match for redirection.
The date and time when the URL mapping was last modified.
Was this page helpful?