canonical: https://jentic.com/apis/hubspot.com/hubspot-cms-url-redirects

# HubSpot Url Redirects

The HubSpot URL Redirects API manages 301 and 302 redirects on HubSpot-hosted CMS sites. It supports listing existing redirects, creating new ones, fetching a redirect by ID, updating destination URLs and precedence, and deleting stale rules. Useful during site migrations, content reorganisation, and SEO maintenance to preserve link equity and avoid broken inbound links.

## For AI agents

Create, list, update, and delete URL redirects on HubSpot-hosted sites. Useful for agents handling site migrations, link maintenance, and SEO redirect rules.

## Scope

Does not handle DNS configuration, domain attachment, or page content edits - use for HubSpot CMS URL redirect rules only.

## Capabilities

- List all current URL redirects with paging support
- Create a new redirect from a routePrefix to a destination URL
- Retrieve a specific redirect rule by its urlRedirectId
- Update the destination, precedence, or match type of a redirect
- Delete a redirect rule when its source path is retired

## Use cases

### Site Migration Redirect Mapping

When migrating content into HubSpot or restructuring an existing HubSpot site, the URL Redirects API lets an agent create 301 redirects for every legacy path so SEO equity and inbound links survive the move. Each call to POST /cms/v3/url-redirects/ accepts source path, destination, precedence, and redirect type.

Example prompt: Read a CSV of legacy-to-new URL pairs and POST /cms/v3/url-redirects/ for each row with redirectStyle 301 and the target path.

### Broken Link Maintenance

List existing redirects via GET /cms/v3/url-redirects/, identify rules whose destination now returns a 404, and update or delete them. This keeps the redirect ruleset clean and avoids redirect chains that hurt page load and crawl budgets.

Example prompt: GET /cms/v3/url-redirects/ paginated, check each destination URL with HEAD requests, and PATCH /cms/v3/url-redirects/{urlRedirectId} or DELETE for any redirect whose target is dead.

### Campaign Vanity URL Provisioning

Create short, memorable redirect rules pointing campaign vanity paths to long landing page URLs. The Redirects API supports flexible match types, so an agent can spin up a vanity URL per campaign as part of a marketing automation workflow.

Example prompt: POST /cms/v3/url-redirects/ with routePrefix `/spring-sale` and destination set to the full sale landing page URL.

### Agent-Managed SEO Hygiene

Give an SEO agent the ability to inspect and maintain HubSpot redirects through Jentic. The agent searches by intent for the right Redirects operation, loads the schema, and executes - no HubSpot-specific code in the agent. Jentic isolates the HubSpot token from the agent's reasoning context.

Example prompt: Use Jentic search 'create a HubSpot URL redirect', load the POST /cms/v3/url-redirects/ schema, and execute with source and destination URLs from the SEO ticket.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /cms/v3/url-redirects/ | List current redirects |
| POST | /cms/v3/url-redirects/ | Create a redirect |
| GET | /cms/v3/url-redirects/{urlRedirectId} | Get details for a redirect |
| PATCH | /cms/v3/url-redirects/{urlRedirectId} | Update a redirect |
| DELETE | /cms/v3/url-redirects/{urlRedirectId} | Delete a redirect |

## Key resources

- **URL redirects** — Single and per-ID redirect operations under /cms/v3/url-redirects/.

## Why Jentic

- **Setup:** Wiring HubSpot URL Redirects by hand means registering an OAuth app or minting a private app token, targeting api.hubapi.com, and coding the list, create, patch, and delete calls plus paging yourself. Through Jentic you install once, import URL Redirects from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** URL Redirects puts the redirect id in the URL path (/cms/v3/url-redirects/{urlRedirectId}), so a rule can pin your agent to reading or updating one redirect rule. You choose the operations it may call, so deleting a redirect is not included unless you add it.
- **Credential handling:** Your HubSpot OAuth token or private app token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a 301 redirect in HubSpot', and Jentic returns the matching URL Redirects operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **HubSpot CMS Pages** — Manage the pages whose URLs are being redirected to or from.
- **HubSpot CMS Domains** — Manage primary and secondary domains served by HubSpot CMS.
- **HubSpot CMS Blog Posts** — Inspect blog post URLs that may need redirects after slug changes.

## FAQ

### What authentication does the HubSpot URL Redirects API use?

OAuth 2.0 authorization code flow or a private app token in the `private-app-legacy` header. Through Jentic, credentials are stored encrypted and the agent only ever sees a scoped execution token.

### Can I create a 301 redirect with the URL Redirects API?

Yes. POST /cms/v3/url-redirects/ accepts a `redirectStyle` field - set it to 301 for permanent redirects or 302 for temporary, along with `routePrefix` (source) and `destination` URL.

### What are the rate limits for the URL Redirects API?

Standard HubSpot CMS API limits apply - roughly 100 requests per 10 seconds per OAuth app, with daily caps of 250,000 on most paid tiers. Throttle bulk redirect imports to stay within those limits.

### How do I bulk-create redirects after a migration through Jentic?

Search Jentic for `create a URL redirect`, load the POST /cms/v3/url-redirects/ schema, and call execute in a loop over your migration mapping. Install with `pip install jentic` and use your `JENTIC_AGENT_API_KEY` for auth.

### Does the URL Redirects API support pattern matching?

Yes. Each redirect record has a `precedence` and `matchType` field that supports exact-match and prefix-style routing, controlled via the create and PATCH endpoints.

### Can I limit what my agent is allowed to do with the HubSpot URL Redirects API?

Yes. Jentic One is self-hosted, so you write the rules that decide which URL Redirects operations your agent may call and which HubSpot credentials it may use. Because the redirect id sits in the path (/cms/v3/url-redirects/{urlRedirectId}), you can pin the agent to listing or updating a single redirect rule while withholding create or delete. Deleting a redirect is not available to the agent unless you explicitly add that operation to its allowed set.
