:doc:`Personalize <../../personalize>` / Client / create_schema

*************
create_schema
*************



.. py:method:: Personalize.Client.create_schema(**kwargs)

  

  Creates an Amazon Personalize schema from the specified schema string. The schema you create must be in Avro JSON format.

   

  Amazon Personalize recognizes three schema variants. Each schema is associated with a dataset type and has a set of required field and keywords. If you are creating a schema for a dataset in a Domain dataset group, you provide the domain of the Domain dataset group. You specify a schema when you call `CreateDataset <https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDataset.html>`__.

   

  **Related APIs**

   

  
  * `ListSchemas <https://docs.aws.amazon.com/personalize/latest/dg/API_ListSchemas.html>`__
   
  * `DescribeSchema <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSchema.html>`__
   
  * `DeleteSchema <https://docs.aws.amazon.com/personalize/latest/dg/API_DeleteSchema.html>`__
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateSchema>`_  


  **Request Syntax**
  ::

    response = client.create_schema(
        name='string',
        schema='string',
        domain='ECOMMERCE'|'VIDEO_ON_DEMAND'
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    The name for the schema.

    

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

    A schema in Avro JSON format.

    

  
  :type domain: string
  :param domain: 

    The domain for the schema. If you are creating a schema for a dataset in a Domain dataset group, specify the domain you chose when you created the Domain dataset group.

    

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

    
    ::

      {
          'schemaArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **schemaArn** *(string) --* 

        The Amazon Resource Name (ARN) of the created schema.

        
  
  **Exceptions**
  
  *   :py:class:`Personalize.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Personalize.Client.exceptions.ResourceAlreadyExistsException`

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

  