HubSpot: Create URL mapping
HubSpot urlMappings.createUrlMapping: arguments, response, policy and SDK examples.
← Url mappings operations · Get started
Operation hubspot.url_mappings_create_url_mapping
Provider route: POST /url-mappings/2026-09/url-mappings. 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["urlMappings"]["createUrlMapping"]>[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.urlMappings.createUrlMapping(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_mappings.create_url_mapping(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Create URL mapping — request body — body |
Referenced models: Create URL mapping — request body — body
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 |
|---|---|---|---|
$ | JSON | Root |
Schemas
Section titled “Schemas”Create URL mapping — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
cdnPurgeEmbargoTime | integer | Required within parent | A Unix timestamp in milliseconds indicating the embargo time for CDN purge related to the URL mapping. Format: int64 |
contentGroupId | integer | Required within parent | A 64-bit integer representing the content group associated with the URL mapping. Format: int64 |
cosObjectType | string | Required within parent | A string representing the type of content object associated with the URL mapping. Valid values include various content types such as 'CONTENT', 'LAYOUT', 'FILE', etc. One of: ACCESS_GROUP_MEMBERSHIP, APP_PAGE, BLOCK, BLOG, BLOG_AUTHOR, BRAND_BUSINESS_UNIT, BRAND_SETTINGS, CONTACT_MEMBERSHIP, CONTENT, CONTENT_EMBED, CONTENT_FOLDER, CONTENT_GROUP, CRM_OBJECT, CRM_OBJECT_TYPE, CUSTOM_WIDGET, CUSTOMER_PORTAL, DATA_QUERY, DESIGN_FOLDER, DOMAIN, DOMAIN_SETTINGS, EMAIL_ADDRESS, EXTENSION_RESOURCE, FILE, FOLDER, FOLLOW_ME, FORM, GLOBAL_CONTENT, GLOBAL_STYLES_THEME, HUBDB_TABLE, HUBDB_TABLE_ROW, IMAGE, JS_PROJECT_COMPONENT, KNOWLEDGE_BASE, KNOWLEDGE_CATEGORY, KNOWLEDGE_CATEGORY_TRANSLATION, KNOWLEDGE_HOMEPAGE_CATEGORY, LAYOUT, LAYOUT_SECTION, LIST_MEMBERSHIP, MARKETPLACE_LISTING, PASSWORD_PROTECTED, PAYMENT, PERSONALIZATION_TOKEN, PLACEMENT, PROJECT, QUOTE_TEMPLATE, RAW_ASSET, REDIRECT_URL, SECTION, SERVERLESS_FUNCTION, SITE_MAP, SITE_MENU, SITE_SETTINGS, SUBSCRIPTIONS_SETTINGS, TAG, THEME, THEME_SETTINGS, UNRESTRICTED_ACCESS, URL_MAPPING, VIDEO_PLAYER, WIDGET, WORKFLOW |
created | integer | Required within parent | A Unix timestamp in milliseconds indicating when the URL mapping was created. Format: int64 |
createdById | integer | Required within parent | The identifier of the user who created the URL mapping. Format: int32 |
deletedAt | integer | Required within parent | A Unix timestamp in milliseconds indicating when the URL mapping was deleted. Format: int64 |
destination | string | Required within parent | The destination URL to which the routePrefix is redirected. |
id | integer | Required within parent | The unique identifier for the URL mapping, represented as a 64-bit integer. Format: int64 |
internallyCreated | boolean | Required within parent | A boolean indicating if the URL mapping was created internally by the system. |
isActive | boolean | Required within parent | A boolean indicating if the URL mapping is currently active. |
isMatchFullUrl | boolean | Required within parent | A boolean indicating if the full URL should be matched. |
isMatchQueryString | boolean | Required within parent | A boolean indicating if the query string should be matched. |
isOnlyAfterNotFound | boolean | Required within parent | A boolean indicating if the mapping should only be applied after a 404 Not Found response. |
isPattern | boolean | Required within parent | A boolean indicating if the routePrefix is a pattern. |
isProtocolAgnostic | boolean | Required within parent | A boolean indicating if the mapping should ignore the URL protocol (http/https). |
isRegex | boolean | Required within parent | A boolean indicating if the routePrefix should be treated as a regular expression. |
isTrailingSlashOptional | boolean | Required within parent | A boolean indicating if the trailing slash in the URL is optional. |
label | string | Required within parent | A label for the URL mapping. |
lastUsedAt | integer | Required within parent | A Unix timestamp in milliseconds indicating the last time the URL mapping was used. Format: int64 |
name | string | Required within parent | The name of the URL mapping. |
note | string | Required within parent | A string containing notes about the URL mapping. |
portalId | integer | Required within parent | The identifier for the HubSpot portal associated with this URL mapping. Format: int32 |
precedence | integer | Required within parent | An integer representing the precedence of the URL mapping, used to determine order of evaluation. Format: int32 |
redirectStyle | integer | Required within parent | An integer representing the style of redirection used. Format: int32 |
routePrefix | string | Required within parent | The prefix of the URL path that is being mapped. |
updated | integer | Required within parent | A Unix timestamp in milliseconds indicating when the URL mapping was last updated. Format: int64 |
updatedById | integer | Required within parent | The identifier of the user who last updated the URL mapping. Format: int32 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: hubspot.url_mappings_create_url_mapping. Catalog operation: url_mappings_create_url_mapping. 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"]