Skip to main content
POST
/
url-mappings
/
v3
/
url-mappings
cURL
curl --request POST \
  --url https://api.hubapi.com/url-mappings/v3/url-mappings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cdnPurgeEmbargoTime": 123,
  "contentGroupId": 123,
  "created": 123,
  "createdById": 123,
  "deletedAt": 123,
  "destination": "<string>",
  "id": 123,
  "internallyCreated": true,
  "isActive": true,
  "isMatchFullUrl": true,
  "isMatchQueryString": true,
  "isOnlyAfterNotFound": true,
  "isPattern": true,
  "isProtocolAgnostic": true,
  "isRegex": true,
  "isTrailingSlashOptional": true,
  "label": "<string>",
  "lastUsedAt": 123,
  "name": "<string>",
  "note": "<string>",
  "portalId": 123,
  "precedence": 123,
  "redirectStyle": 123,
  "routePrefix": "<string>",
  "updated": 123,
  "updatedById": 123
}
'
import requests

url = "https://api.hubapi.com/url-mappings/v3/url-mappings"

payload = {
"cdnPurgeEmbargoTime": 123,
"contentGroupId": 123,
"created": 123,
"createdById": 123,
"deletedAt": 123,
"destination": "<string>",
"id": 123,
"internallyCreated": True,
"isActive": True,
"isMatchFullUrl": True,
"isMatchQueryString": True,
"isOnlyAfterNotFound": True,
"isPattern": True,
"isProtocolAgnostic": True,
"isRegex": True,
"isTrailingSlashOptional": True,
"label": "<string>",
"lastUsedAt": 123,
"name": "<string>",
"note": "<string>",
"portalId": 123,
"precedence": 123,
"redirectStyle": 123,
"routePrefix": "<string>",
"updated": 123,
"updatedById": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cdnPurgeEmbargoTime: 123,
contentGroupId: 123,
created: 123,
createdById: 123,
deletedAt: 123,
destination: '<string>',
id: 123,
internallyCreated: true,
isActive: true,
isMatchFullUrl: true,
isMatchQueryString: true,
isOnlyAfterNotFound: true,
isPattern: true,
isProtocolAgnostic: true,
isRegex: true,
isTrailingSlashOptional: true,
label: '<string>',
lastUsedAt: 123,
name: '<string>',
note: '<string>',
portalId: 123,
precedence: 123,
redirectStyle: 123,
routePrefix: '<string>',
updated: 123,
updatedById: 123
})
};

fetch('https://api.hubapi.com/url-mappings/v3/url-mappings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/url-mappings/v3/url-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cdnPurgeEmbargoTime' => 123,
'contentGroupId' => 123,
'created' => 123,
'createdById' => 123,
'deletedAt' => 123,
'destination' => '<string>',
'id' => 123,
'internallyCreated' => true,
'isActive' => true,
'isMatchFullUrl' => true,
'isMatchQueryString' => true,
'isOnlyAfterNotFound' => true,
'isPattern' => true,
'isProtocolAgnostic' => true,
'isRegex' => true,
'isTrailingSlashOptional' => true,
'label' => '<string>',
'lastUsedAt' => 123,
'name' => '<string>',
'note' => '<string>',
'portalId' => 123,
'precedence' => 123,
'redirectStyle' => 123,
'routePrefix' => '<string>',
'updated' => 123,
'updatedById' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.hubapi.com/url-mappings/v3/url-mappings"

payload := strings.NewReader("{\n \"cdnPurgeEmbargoTime\": 123,\n \"contentGroupId\": 123,\n \"created\": 123,\n \"createdById\": 123,\n \"deletedAt\": 123,\n \"destination\": \"<string>\",\n \"id\": 123,\n \"internallyCreated\": true,\n \"isActive\": true,\n \"isMatchFullUrl\": true,\n \"isMatchQueryString\": true,\n \"isOnlyAfterNotFound\": true,\n \"isPattern\": true,\n \"isProtocolAgnostic\": true,\n \"isRegex\": true,\n \"isTrailingSlashOptional\": true,\n \"label\": \"<string>\",\n \"lastUsedAt\": 123,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"portalId\": 123,\n \"precedence\": 123,\n \"redirectStyle\": 123,\n \"routePrefix\": \"<string>\",\n \"updated\": 123,\n \"updatedById\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.hubapi.com/url-mappings/v3/url-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cdnPurgeEmbargoTime\": 123,\n \"contentGroupId\": 123,\n \"created\": 123,\n \"createdById\": 123,\n \"deletedAt\": 123,\n \"destination\": \"<string>\",\n \"id\": 123,\n \"internallyCreated\": true,\n \"isActive\": true,\n \"isMatchFullUrl\": true,\n \"isMatchQueryString\": true,\n \"isOnlyAfterNotFound\": true,\n \"isPattern\": true,\n \"isProtocolAgnostic\": true,\n \"isRegex\": true,\n \"isTrailingSlashOptional\": true,\n \"label\": \"<string>\",\n \"lastUsedAt\": 123,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"portalId\": 123,\n \"precedence\": 123,\n \"redirectStyle\": 123,\n \"routePrefix\": \"<string>\",\n \"updated\": 123,\n \"updatedById\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hubapi.com/url-mappings/v3/url-mappings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cdnPurgeEmbargoTime\": 123,\n \"contentGroupId\": 123,\n \"created\": 123,\n \"createdById\": 123,\n \"deletedAt\": 123,\n \"destination\": \"<string>\",\n \"id\": 123,\n \"internallyCreated\": true,\n \"isActive\": true,\n \"isMatchFullUrl\": true,\n \"isMatchQueryString\": true,\n \"isOnlyAfterNotFound\": true,\n \"isPattern\": true,\n \"isProtocolAgnostic\": true,\n \"isRegex\": true,\n \"isTrailingSlashOptional\": true,\n \"label\": \"<string>\",\n \"lastUsedAt\": 123,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"portalId\": 123,\n \"precedence\": 123,\n \"redirectStyle\": 123,\n \"routePrefix\": \"<string>\",\n \"updated\": 123,\n \"updatedById\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "message": "Invalid input (details will vary based on the error)",
  "correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
  "category": "VALIDATION_ERROR",
  "links": {
    "knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
  }
}

Supported products

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
cdnPurgeEmbargoTime
integer<int64>
required
contentGroupId
integer<int64>
required
cosObjectType
enum<string>
required
Available options:
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<int64>
required
createdById
integer<int32>
required
deletedAt
integer<int64>
required
destination
string
required

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

id
integer<int64>
required

The unique ID of this URL redirect.

internallyCreated
boolean
required
isActive
boolean
required
isMatchFullUrl
boolean
required

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

isMatchQueryString
boolean
required

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

isOnlyAfterNotFound
boolean
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.

isPattern
boolean
required

Whether the routePrefix should match based on pattern.

isProtocolAgnostic
boolean
required

Whether the routePrefix should match both HTTP and HTTPS protocols.

isRegex
boolean
required
isTrailingSlashOptional
boolean
required

Whether a trailing slash will be ignored.

label
string
required
lastUsedAt
integer<int64>
required
name
string
required
note
string
required
portalId
integer<int32>
required
precedence
integer<int32>
required

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

redirectStyle
integer<int32>
required

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

routePrefix
string
required

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

updated
integer<int64>
required
updatedById
integer<int32>
required

Response

default - */*
category
string
required

The error category

correlationId
string<uuid>
required

A unique identifier for the request. Include this value with any error reports or support tickets

Example:

"aeb5f871-7f07-4993-9211-075dc63e7cbf"

message
string
required

A human readable message describing the error along with remediation steps where appropriate

Example:

"An error occurred"

context
object

Context about the error condition

Example:

"{invalidPropertyName=[propertyValue], missingScopes=[scope1, scope2]}"

errors
object[]

further information about the error

A map of link names to associated URIs containing documentation about the error or recommended remediation steps

subCategory
string

A specific category that contains more specific detail about the error

Last modified on March 25, 2026