HubSpot: List URL Redirects
HubSpot urlRedirects.getUrlRedirects: arguments, response, policy and SDK examples.
← Url redirects operations · Get started
Operation hubspot.url_redirects_get_url_redirects
Provider route: GET /cms/url-redirects/2026-09. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/hubspot with npm, or alter-sdk-hubspot with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { HubSpotIntegration } from "@alter-ai/hubspot";
async function execute(input: Parameters<HubSpotIntegration["urlRedirects"]["getUrlRedirects"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new HubSpotIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.urlRedirects.getUrlRedirects(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_hubspot import HubSpotIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = HubSpotIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.url_redirects.get_url_redirects(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | Model | Optional | Expand List Domains — request body — query |
Referenced models: List Domains — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List URL Redirects — response body |
Referenced models: List URL Redirects — response body
Schemas
Section titled “Schemas”List URL Redirects — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
paging | Model | Optional | Expand List URL Redirects — response body — paging |
results | array | Required within parent | An array of UrlMapping objects, each representing a specific URL mapping. |
results[] | Model | Each item | Expand Update a redirect — response body |
total | JSON | Required within parent | |
total (anyOf 1) | integer | Alternative | The total number of URL mappings available. Format: int32 |
total (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: List URL Redirects — response body — paging, Update a redirect — response body
List Domains — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
after | string | Optional | |
archived | boolean | Optional | |
createdAfter | string | Optional | Format: date-time |
createdAt | string | Optional | Format: date-time |
createdBefore | string | Optional | Format: date-time |
limit | integer | Optional | Format: int32 |
sort | array | Optional | |
sort[] | string | Each item | |
updatedAfter | string | Optional | Format: date-time |
updatedAt | string | Optional | Format: date-time |
updatedBefore | string | Optional | Format: date-time |
List URL Redirects — response body — paging
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Paging information for forward-only pagination. Contains the next page reference when more results are available; omitted or empty on the last page. |
next | Model | Optional | Expand List URL Redirects — response body — paging next |
Referenced models: List URL Redirects — response body — paging next
Update a redirect — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
created | string | Required within parent | The date and time when the URL mapping was initially created. Format: date-time |
destination | string | Required within parent | The destination URL, where the target URL should be redirected if it matches the `routePrefix`. |
id | string | Required within parent | The unique ID of this URL redirect. |
isMatchFullUrl | boolean | Required within parent | Whether the `routePrefix` should match on the entire URL, including the domain. |
isMatchQueryString | boolean | Required within parent | Whether the `routePrefix` should match on the entire URL path, including the query string. |
isOnlyAfterNotFound | boolean | Required within parent | 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. |
isPattern | boolean | Required within parent | Whether the `routePrefix` should match based on pattern. |
isProtocolAgnostic | boolean | Required within parent | Whether the `routePrefix` should match both HTTP and HTTPS protocols. |
isTrailingSlashOptional | boolean | Required within parent | Whether a trailing slash will be ignored. |
precedence | JSON | Required within parent | |
precedence (anyOf 1) | integer | Alternative | Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the **lower** precedence will be used. Format: int32 |
precedence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
redirectStyle | JSON | Required within parent | |
redirectStyle (anyOf 1) | integer | Alternative | The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details [here](https://knowledge.hubspot.com/cos-general/how-to-redirect-a-hubspot-page). Format: int32 |
redirectStyle (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
routePrefix | string | Required within parent | The target incoming URL, path, or pattern to match for redirection. |
updated | string | Required within parent | The date and time when the URL mapping was last modified. Format: date-time |
List URL Redirects — response body — paging next
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Specifies the paging information needed to retrieve the next set of results in a paginated API response |
after | string | Required within parent | The cursor value indicating where to begin fetching the next page of results in a paginated collection. |
link | string | Optional | An optional URL for directly accessing the next page of results. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: hubspot.url_redirects_get_url_redirects. Catalog operation: url_redirects_get_url_redirects. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["content"]