:doc:`QBusiness <../../qbusiness>` / Client / create_subscription

*******************
create_subscription
*******************



.. py:method:: QBusiness.Client.create_subscription(**kwargs)

  

  Subscribes an IAM Identity Center user or a group to a pricing tier for an Amazon Q Business application.

   

  Amazon Q Business offers two subscription tiers: ``Q_LITE`` and ``Q_BUSINESS``. Subscription tier determines feature access for the user. For more information on subscriptions and pricing tiers, see `Amazon Q Business pricing <https://aws.amazon.com/q/business/pricing/>`__.

   

  .. note::

    

    For an example IAM role policy for assigning subscriptions, see `Set up required permissions <https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/setting-up.html#permissions>`__ in the Amazon Q Business User Guide.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateSubscription>`_  


  **Request Syntax**
  ::

    response = client.create_subscription(
        applicationId='string',
        principal={
            'user': 'string',
            'group': 'string'
        },
        type='Q_LITE'|'Q_BUSINESS',
        clientToken='string'
    )
    
  :type applicationId: string
  :param applicationId: **[REQUIRED]** 

    The identifier of the Amazon Q Business application the subscription should be added to.

    

  
  :type principal: dict
  :param principal: **[REQUIRED]** 

    The IAM Identity Center ``UserId`` or ``GroupId`` of a user or group in the IAM Identity Center instance connected to the Amazon Q Business application.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``user``, ``group``. 

  
    - **user** *(string) --* 

      The identifier of a user in the IAM Identity Center instance connected to the Amazon Q Business application.

      

    
    - **group** *(string) --* 

      The identifier of a group in the IAM Identity Center instance connected to the Amazon Q Business application.

      

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

    The type of Amazon Q Business subscription you want to create.

    

  
  :type clientToken: string
  :param clientToken: 

    A token that you provide to identify the request to create a subscription for your Amazon Q Business application.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'subscriptionId': 'string',
          'subscriptionArn': 'string',
          'currentSubscription': {
              'type': 'Q_LITE'|'Q_BUSINESS'
          },
          'nextSubscription': {
              'type': 'Q_LITE'|'Q_BUSINESS'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **subscriptionId** *(string) --* 

        The identifier of the Amazon Q Business subscription created.

        
      

      - **subscriptionArn** *(string) --* 

        The Amazon Resource Name (ARN) of the Amazon Q Business subscription created.

        
      

      - **currentSubscription** *(dict) --* 

        The type of your current Amazon Q Business subscription.

        
        

        - **type** *(string) --* 

          The type of an Amazon Q Business subscription.

          
    
      

      - **nextSubscription** *(dict) --* 

        The type of the Amazon Q Business subscription for the next month.

        
        

        - **type** *(string) --* 

          The type of an Amazon Q Business subscription.

          
    
  
  **Exceptions**
  
  *   :py:class:`QBusiness.Client.exceptions.InternalServerException`

  
  *   :py:class:`QBusiness.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`QBusiness.Client.exceptions.ThrottlingException`

  
  *   :py:class:`QBusiness.Client.exceptions.ValidationException`

  
  *   :py:class:`QBusiness.Client.exceptions.AccessDeniedException`

  