:doc:`APIGateway <../../apigateway>` / Client / create_model

************
create_model
************



.. py:method:: APIGateway.Client.create_model(**kwargs)

  

  Adds a new Model resource to an existing RestApi resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apigateway-2015-07-09/CreateModel>`_  


  **Request Syntax**
  ::

    response = client.create_model(
        restApiId='string',
        name='string',
        description='string',
        schema='string',
        contentType='string'
    )
    
  :type restApiId: string
  :param restApiId: **[REQUIRED]** 

    The RestApi identifier under which the Model will be created.

    

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

    The name of the model. Must be alphanumeric.

    

  
  :type description: string
  :param description: 

    The description of the model.

    

  
  :type schema: string
  :param schema: 

    The schema for the model. For ``application/json`` models, this should be JSON schema draft 4 model. The maximum size of the model is 400 KB.

    

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

    The content-type for the model.

    

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

    
    ::

      {
          'id': 'string',
          'name': 'string',
          'description': 'string',
          'schema': 'string',
          'contentType': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the data structure of a method's request or response payload.

      
      

      - **id** *(string) --* 

        The identifier for the model resource.

        
      

      - **name** *(string) --* 

        The name of the model. Must be an alphanumeric string.

        
      

      - **description** *(string) --* 

        The description of the model.

        
      

      - **schema** *(string) --* 

        The schema for the model. For ``application/json`` models, this should be JSON schema draft 4 model. Do not include "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.

        
      

      - **contentType** *(string) --* 

        The content-type for the model.

        
  
  **Exceptions**
  
  *   :py:class:`APIGateway.Client.exceptions.BadRequestException`

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

  
  *   :py:class:`APIGateway.Client.exceptions.LimitExceededException`

  
  *   :py:class:`APIGateway.Client.exceptions.NotFoundException`

  
  *   :py:class:`APIGateway.Client.exceptions.UnauthorizedException`

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

  