> ## Documentation Index
> Fetch the complete documentation index at: https://developers.hubspot.fr/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: Mappages d'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: La catégorie d'erreur
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Contexte concernant la condition d'erreur
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: >-
            Un identifiant unique pour la demande. Incluez cette valeur dans
            tous les rapports d'erreurs ou tickets d'assistance
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: informations supplémentaires à propos de l'erreur
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: >-
            Une carte des noms de liens vers les URI associés contenant de la
            documentation sur l'erreur ou les mesures correctives recommandées
        message:
          type: string
          description: >-
            Un message lisible par la personne décrivant l'erreur ainsi que les
            mesures correctives possibles, le cas échéant
          example: An error occurred
        subCategory:
          type: string
          description: >-
            Une catégorie spécifique qui contient des détails plus précis sur
            l'erreur
      description: >-
        Représente une réponse d'erreur renvoyée par l'API lorsqu'une opération
        échoue. Ce composant est utilisé dans divers points de terminaison pour
        fournir des informations détaillées sur l'erreur rencontrée.
      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: Le code du statut associé au détail de l'erreur
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Contexte concernant la condition d'erreur
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: Le nom du champ ou du paramètre dans lequel l'erreur a été trouvée.
        message:
          type: string
          description: >-
            Un message lisible par la personne décrivant l'erreur ainsi que les
            mesures correctives possibles, le cas échéant
        subCategory:
          type: string
          description: >-
            Une catégorie spécifique qui contient des détails plus précis sur
            l'erreur
      description: >-
        Représente des informations détaillées sur une erreur survenue dans
        l'API. Ce composant est utilisé pour fournir un contexte et des
        spécificités supplémentaires sur les erreurs, généralement dans le cadre
        d'une réponse d'erreur.
  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: ''

````