> ## Documentation Index
> Fetch the complete documentation index at: https://br.developers.hubspot.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a mapping

> **Supported products**

> **Required Scopes**


## OpenAPI

````yaml specs/legacy/v3/cms-url-mappings-v3.json POST /url-mappings/v3/url-mappings
openapi: 3.0.1
info:
  title: Mapeamentos de URL
  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
security: []
tags:
  - name: Basic
paths:
  /url-mappings/v3/url-mappings:
    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'
        required: true
      responses:
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - content
components:
  schemas:
    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
        contentGroupId:
          type: integer
          format: int64
        cosObjectType:
          type: string
          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
            - 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:
          type: integer
          format: int64
        createdById:
          type: integer
          format: int32
        deletedAt:
          type: integer
          format: int64
        destination:
          type: string
          description: >-
            The destination URL, where the target URL should be redirected if it
            matches the `routePrefix`.
        id:
          type: integer
          description: The unique ID of this URL redirect.
          format: int64
        internallyCreated:
          type: boolean
        isActive:
          type: boolean
        isMatchFullUrl:
          type: boolean
          description: >-
            Whether the `routePrefix` should match on the entire URL, including
            the domain.
        isMatchQueryString:
          type: boolean
          description: >-
            Whether the `routePrefix` should match on the entire URL path,
            including the query string.
        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.
        isPattern:
          type: boolean
          description: Whether the `routePrefix` should match based on pattern.
        isProtocolAgnostic:
          type: boolean
          description: >-
            Whether the `routePrefix` should match both HTTP and HTTPS
            protocols.
        isRegex:
          type: boolean
        isTrailingSlashOptional:
          type: boolean
          description: Whether a trailing slash will be ignored.
        label:
          type: string
        lastUsedAt:
          type: integer
          format: int64
        name:
          type: string
        note:
          type: string
        portalId:
          type: integer
          format: int32
        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
        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
        routePrefix:
          type: string
          description: The target incoming URL, path, or pattern to match for redirection.
        updated:
          type: integer
          format: int64
        updatedById:
          type: integer
          format: int32
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: A categoria de erro
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Contexto sobre a condição do erro
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: >-
            Um identificador exclusivo para a solicitação. Inclua este valor em
            relatórios de erro ou tickets de suporte
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: mais informações sobre o erro
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: >-
            Um mapa de nomes de links para URIs associados que contêm
            documentação sobre o erro ou as etapas de correção recomendadas
        message:
          type: string
          description: >-
            Uma mensagem legível por humanos que descreve o erro, juntamente com
            as etapas de correção, quando apropriado
          example: An error occurred
        subCategory:
          type: string
          description: >-
            Uma categoria específica que contém mais detalhes específicos sobre
            o erro
      description: >-
        Representa uma resposta de erro retornada pela API quando uma operação
        falha. Este componente é usado em vários endpoints para fornecer
        informações detalhadas sobre o erro encontrado.
      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: O código de status associado ao detalhe do erro
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Contexto sobre a condição do erro
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: O nome do campo ou parâmetro no qual o erro foi encontrado.
        message:
          type: string
          description: >-
            Uma mensagem legível por humanos que descreve o erro, juntamente com
            as etapas de correção, quando apropriado
        subCategory:
          type: string
          description: >-
            Uma categoria específica que contém mais detalhes específicos sobre
            o erro
      description: >-
        Representa informações detalhadas sobre um erro ocorrido na API. Este
        componente é usado para fornecer contexto e detalhes adicionais sobre os
        erros, geralmente como parte de uma resposta de erro.
  responses:
    Error:
      description: An error occurred.
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          tokenUrl: https://api.hubapi.com/oauth/v1/token
          scopes:
            content: ''

````