:doc:`ApiGatewayV2 <../../apigatewayv2>` / Client / create_route_response

*********************
create_route_response
*********************



.. py:method:: ApiGatewayV2.Client.create_route_response(**kwargs)

  

  Creates a RouteResponse for a Route.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/CreateRouteResponse>`_  


  **Request Syntax**
  ::

    response = client.create_route_response(
        ApiId='string',
        ModelSelectionExpression='string',
        ResponseModels={
            'string': 'string'
        },
        ResponseParameters={
            'string': {
                'Required': True|False
            }
        },
        RouteId='string',
        RouteResponseKey='string'
    )
    
  :type ApiId: string
  :param ApiId: **[REQUIRED]** 

    The API identifier.

    

  
  :type ModelSelectionExpression: string
  :param ModelSelectionExpression: 

    The model selection expression for the route response. Supported only for WebSocket APIs.

    

  
  :type ResponseModels: dict
  :param ResponseModels: 

    The response models for the route response.

    

  
    - *(string) --* 

    
      - *(string) --* 

        A string with a length between [1-128].

        

      


  :type ResponseParameters: dict
  :param ResponseParameters: 

    The route response parameters.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        Validation constraints imposed on parameters of a request (path, query string, headers).

        

      
        - **Required** *(boolean) --* 

          Whether or not the parameter is required.

          

        
      


  :type RouteId: string
  :param RouteId: **[REQUIRED]** 

    The route ID.

    

  
  :type RouteResponseKey: string
  :param RouteResponseKey: **[REQUIRED]** 

    The route response key.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ModelSelectionExpression': 'string',
          'ResponseModels': {
              'string': 'string'
          },
          'ResponseParameters': {
              'string': {
                  'Required': True|False
              }
          },
          'RouteResponseId': 'string',
          'RouteResponseKey': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The request has succeeded and has resulted in the creation of a resource.

      
      

      - **ModelSelectionExpression** *(string) --* 

        Represents the model selection expression of a route response. Supported only for WebSocket APIs.

        
      

      - **ResponseModels** *(dict) --* 

        Represents the response models of a route response.

        
        

        - *(string) --* 
          

          - *(string) --* 

            A string with a length between [1-128].

            
    
  
      

      - **ResponseParameters** *(dict) --* 

        Represents the response parameters of a route response.

        
        

        - *(string) --* 
          

          - *(dict) --* 

            Validation constraints imposed on parameters of a request (path, query string, headers).

            
            

            - **Required** *(boolean) --* 

              Whether or not the parameter is required.

              
        
    
  
      

      - **RouteResponseId** *(string) --* 

        Represents the identifier of a route response.

        
      

      - **RouteResponseKey** *(string) --* 

        Represents the route response key of a route response.

        
  
  **Exceptions**
  
  *   :py:class:`ApiGatewayV2.Client.exceptions.NotFoundException`

  
  *   :py:class:`ApiGatewayV2.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`ApiGatewayV2.Client.exceptions.BadRequestException`

  
  *   :py:class:`ApiGatewayV2.Client.exceptions.ConflictException`

  