{ "openapi" : "3.0.1", "info" : { "title" : "Url Mappings", "description" : "URL redirect operations", "version" : "v3", "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE", "commerce" : "FREE", "crmHub" : "FREE", "dataHub" : "FREE" } }, "servers" : [ { "url" : "https://api.hubapi.com" } ], "tags" : [ { "name" : "Basic" } ], "paths" : { "/url-mappings/v3/url-mappings" : { "get" : { "tags" : [ "Basic" ], "operationId" : "get-/url-mappings/v3/url-mappings_/url-mappings/v3/url-mappings", "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "type" : "array", "example" : null, "items" : { "$ref" : "#/components/schemas/UrlMapping" } }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] } ] }, "post" : { "tags" : [ "Basic" ], "operationId" : "post-/url-mappings/v3/url-mappings_/url-mappings/v3/url-mappings", "parameters" : [ ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/UrlMapping" }, "example" : null } }, "required" : true }, "responses" : { "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] } ] } }, "/url-mappings/v3/url-mappings/{id}" : { "get" : { "tags" : [ "Basic" ], "operationId" : "get-/url-mappings/v3/url-mappings/{id}_/url-mappings/v3/url-mappings/{id}", "parameters" : [ { "name" : "id", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "pattern" : "\\d+", "type" : "integer", "format" : "int64", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/UrlMapping" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] } ] }, "delete" : { "tags" : [ "Basic" ], "operationId" : "delete-/url-mappings/v3/url-mappings/{id}_/url-mappings/v3/url-mappings/{id}", "parameters" : [ { "name" : "id", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "pattern" : "\\d+", "type" : "integer", "format" : "int64", "example" : null } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "content" ] }, { "oauth2" : [ "cms-url-redirects-delete" ] } ] } } }, "components" : { "schemas" : { "Error" : { "required" : [ "category", "correlationId", "message" ], "type" : "object", "properties" : { "category" : { "type" : "string", "description" : "The error category", "example" : null }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : "Context about the error condition", "example" : "{invalidPropertyName=[propertyValue], missingScopes=[scope1, scope2]}" }, "correlationId" : { "type" : "string", "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", "format" : "uuid", "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" }, "errors" : { "type" : "array", "description" : "further information about the error", "example" : null, "items" : { "$ref" : "#/components/schemas/ErrorDetail" } }, "links" : { "type" : "object", "additionalProperties" : { "type" : "string", "example" : null }, "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps", "example" : null }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : "An error occurred" }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error", "example" : null } }, "example" : { "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" } } }, "ErrorDetail" : { "required" : [ "message" ], "type" : "object", "properties" : { "code" : { "type" : "string", "description" : "The status code associated with the error detail", "example" : null }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : "Context about the error condition", "example" : "{missingScopes=[scope1, scope2]}" }, "in" : { "type" : "string", "description" : "The name of the field or parameter in which the error was found.", "example" : null }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : null }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error", "example" : null } }, "example" : null }, "UrlMapping" : { "required" : [ "cdnPurgeEmbargoTime", "contentGroupId", "cosObjectType", "created", "createdById", "deletedAt", "destination", "id", "internallyCreated", "isActive", "isMatchFullUrl", "isMatchQueryString", "isOnlyAfterNotFound", "isPattern", "isProtocolAgnostic", "isRegex", "isTrailingSlashOptional", "label", "lastUsedAt", "name", "note", "portalId", "precedence", "redirectStyle", "routePrefix", "updated", "updatedById" ], "type" : "object", "properties" : { "cdnPurgeEmbargoTime" : { "type" : "integer", "format" : "int64", "example" : null }, "contentGroupId" : { "type" : "integer", "format" : "int64", "example" : null }, "cosObjectType" : { "type" : "string", "example" : null, "enum" : [ "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", "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" : { "type" : "integer", "format" : "int64", "example" : null }, "createdById" : { "type" : "integer", "format" : "int32", "example" : null }, "deletedAt" : { "type" : "integer", "format" : "int64", "example" : null }, "destination" : { "type" : "string", "description" : "The destination URL, where the target URL should be redirected if it matches the `routePrefix`.", "example" : null }, "id" : { "type" : "integer", "description" : "The unique ID of this URL redirect.", "format" : "int64", "example" : null }, "internallyCreated" : { "type" : "boolean", "example" : null }, "isActive" : { "type" : "boolean", "example" : null }, "isMatchFullUrl" : { "type" : "boolean", "description" : "Whether the `routePrefix` should match on the entire URL, including the domain.", "example" : null }, "isMatchQueryString" : { "type" : "boolean", "description" : "Whether the `routePrefix` should match on the entire URL path, including the query string.", "example" : null }, "isOnlyAfterNotFound" : { "type" : "boolean", "description" : "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.", "example" : null }, "isPattern" : { "type" : "boolean", "description" : "Whether the `routePrefix` should match based on pattern.", "example" : null }, "isProtocolAgnostic" : { "type" : "boolean", "description" : "Whether the `routePrefix` should match both HTTP and HTTPS protocols.", "example" : null }, "isRegex" : { "type" : "boolean", "example" : null }, "isTrailingSlashOptional" : { "type" : "boolean", "description" : "Whether a trailing slash will be ignored.", "example" : null }, "label" : { "type" : "string", "example" : null }, "lastUsedAt" : { "type" : "integer", "format" : "int64", "example" : null }, "name" : { "type" : "string", "example" : null }, "note" : { "type" : "string", "example" : null }, "portalId" : { "type" : "integer", "format" : "int32", "example" : null }, "precedence" : { "type" : "integer", "description" : "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", "example" : null }, "redirectStyle" : { "type" : "integer", "description" : "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", "example" : null }, "routePrefix" : { "type" : "string", "description" : "The target incoming URL, path, or pattern to match for redirection.", "example" : null }, "updated" : { "type" : "integer", "format" : "int64", "example" : null }, "updatedById" : { "type" : "integer", "format" : "int32", "example" : null } }, "example" : null } }, "responses" : { "Error" : { "description" : "An error occurred.", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Error" }, "example" : null } } } }, "securitySchemes" : { "developer_hapikey" : { "type" : "apiKey", "name" : "hapikey", "in" : "query" }, "oauth2" : { "type" : "oauth2", "flows" : { "authorizationCode" : { "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", "scopes" : { "cms-url-redirects-delete" : "", "content" : "" } } } }, "private_apps" : { "type" : "apiKey", "name" : "private-app", "in" : "header" }, "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", "in" : "header" } } }, "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE", "commerce" : "FREE", "crmHub" : "FREE", "dataHub" : "FREE" } }