:doc:`PartnerCentralSellingAPI <../../partnercentral-selling>` / Client / start_opportunity_from_engagement_task

**************************************
start_opportunity_from_engagement_task
**************************************



.. py:method:: PartnerCentralSellingAPI.Client.start_opportunity_from_engagement_task(**kwargs)

  

  This action creates an opportunity from an existing engagement context. The task is asynchronous and orchestrates the process of converting engagement contextual information into a structured opportunity record within the partner's account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/partnercentral-selling-2022-07-26/StartOpportunityFromEngagementTask>`_  


  **Request Syntax**
  ::

    response = client.start_opportunity_from_engagement_task(
        Catalog='string',
        ClientToken='string',
        Identifier='string',
        ContextIdentifier='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type Catalog: string
  :param Catalog: **[REQUIRED]** 

    Specifies the catalog in which the opportunity creation task is executed. Acceptable values include ``AWS`` for production and ``Sandbox`` for testing environments.

    

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

    A unique token provided by the client to help ensure the idempotency of the request. It helps prevent the same task from being performed multiple times.

    This field is autopopulated if not provided.

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

    The unique identifier of the engagement from which the opportunity creation task is to be initiated. This helps ensure that the task is applied to the correct engagement.

    

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

    The unique identifier of the engagement context from which to create the opportunity. This specifies the specific contextual information within the engagement that will be used for opportunity creation.

    

  
  :type Tags: list
  :param Tags: 

    A map of the key-value pairs of the tag or tags to assign.

    

  
    - *(dict) --* 

      The key-value pair assigned to a specified resource.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key in the tag.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The value in the tag.

        

      
    

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

    
    ::

      {
          'TaskId': 'string',
          'TaskArn': 'string',
          'StartTime': datetime(2015, 1, 1),
          'TaskStatus': 'IN_PROGRESS'|'COMPLETE'|'FAILED',
          'Message': 'string',
          'ReasonCode': 'InvitationAccessDenied'|'InvitationValidationFailed'|'EngagementAccessDenied'|'OpportunityAccessDenied'|'ResourceSnapshotJobAccessDenied'|'ResourceSnapshotJobValidationFailed'|'ResourceSnapshotJobConflict'|'EngagementValidationFailed'|'EngagementConflict'|'OpportunitySubmissionFailed'|'EngagementInvitationConflict'|'InternalError'|'OpportunityValidationFailed'|'OpportunityConflict'|'ResourceSnapshotAccessDenied'|'ResourceSnapshotValidationFailed'|'ResourceSnapshotConflict'|'ServiceQuotaExceeded'|'RequestThrottled'|'ContextNotFound'|'CustomerProjectContextNotPermitted'|'DisqualifiedLeadNotPermitted',
          'OpportunityId': 'string',
          'ResourceSnapshotJobId': 'string',
          'EngagementId': 'string',
          'ContextId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TaskId** *(string) --* 

        The unique identifier of the task, used to track the task's progress.

        
      

      - **TaskArn** *(string) --* 

        The Amazon Resource Name (ARN) of the task, used for tracking and managing the task within AWS.

        
      

      - **StartTime** *(datetime) --* 

        The timestamp indicating when the task was initiated. The format follows RFC 3339 section 5.6.

        
      

      - **TaskStatus** *(string) --* 

        Indicates the current status of the task.

        
      

      - **Message** *(string) --* 

        If the task fails, this field contains a detailed message describing the failure and possible recovery steps.

        
      

      - **ReasonCode** *(string) --* 

        Indicates the reason for task failure using an enumerated code.

        
      

      - **OpportunityId** *(string) --* 

        The unique identifier of the opportunity created as a result of the task. This field is populated when the task is completed successfully.

        
      

      - **ResourceSnapshotJobId** *(string) --* 

        The identifier of the resource snapshot job created as part of the opportunity creation process.

        
      

      - **EngagementId** *(string) --* 

        The unique identifier of the engagement from which the opportunity was created.

        
      

      - **ContextId** *(string) --* 

        The unique identifier of the engagement context used to create the opportunity.

        
  
  **Exceptions**
  
  *   :py:class:`PartnerCentralSellingAPI.Client.exceptions.ConflictException`

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

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

  
  *   :py:class:`PartnerCentralSellingAPI.Client.exceptions.InternalServerException`

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

  
  *   :py:class:`PartnerCentralSellingAPI.Client.exceptions.ServiceQuotaExceededException`

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

  