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

**************
list_campaigns
**************



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

  

  Returns a list of campaigns that use the given solution. When a solution is not specified, all the campaigns associated with the account are listed. The response provides the properties for each campaign, including the Amazon Resource Name (ARN). For more information on campaigns, see `CreateCampaign <https://docs.aws.amazon.com/personalize/latest/dg/API_CreateCampaign.html>`__.

  

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


  **Request Syntax**
  ::

    response = client.list_campaigns(
        solutionArn='string',
        nextToken='string',
        maxResults=123
    )
    
  :type solutionArn: string
  :param solutionArn: 

    The Amazon Resource Name (ARN) of the solution to list the campaigns for. When a solution is not specified, all the campaigns associated with the account are listed.

    

  
  :type nextToken: string
  :param nextToken: 

    A token returned from the previous call to `ListCampaigns <https://docs.aws.amazon.com/personalize/latest/dg/API_ListCampaigns.html>`__ for getting the next set of campaigns (if they exist).

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of campaigns to return.

    

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

    
    ::

      {
          'campaigns': [
              {
                  'name': 'string',
                  'campaignArn': 'string',
                  'status': 'string',
                  'creationDateTime': datetime(2015, 1, 1),
                  'lastUpdatedDateTime': datetime(2015, 1, 1),
                  'failureReason': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **campaigns** *(list) --* 

        A list of the campaigns.

        
        

        - *(dict) --* 

          Provides a summary of the properties of a campaign. For a complete listing, call the `DescribeCampaign <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeCampaign.html>`__ API.

          
          

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

            The name of the campaign.

            
          

          - **campaignArn** *(string) --* 

            The Amazon Resource Name (ARN) of the campaign.

            
          

          - **status** *(string) --* 

            The status of the campaign.

             

            A campaign can be in one of the following states:

             

            
            * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
             
            * DELETE PENDING > DELETE IN_PROGRESS
            

            
          

          - **creationDateTime** *(datetime) --* 

            The date and time (in Unix time) that the campaign was created.

            
          

          - **lastUpdatedDateTime** *(datetime) --* 

            The date and time (in Unix time) that the campaign was last updated.

            
          

          - **failureReason** *(string) --* 

            If a campaign fails, the reason behind the failure.

            
      
    
      

      - **nextToken** *(string) --* 

        A token for getting the next set of campaigns (if they exist).

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

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

  