:doc:`SSMContacts <../../ssm-contacts>` / Client / list_contacts

*************
list_contacts
*************



.. py:method:: SSMContacts.Client.list_contacts(**kwargs)

  

  Lists all contacts and escalation plans in Incident Manager.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-contacts-2021-05-03/ListContacts>`_  


  **Request Syntax**
  ::

    response = client.list_contacts(
        NextToken='string',
        MaxResults=123,
        AliasPrefix='string',
        Type='PERSONAL'|'ESCALATION'|'ONCALL_SCHEDULE'
    )
    
  :type NextToken: string
  :param NextToken: 

    The pagination token to continue to the next page of results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of contacts and escalation plans per page of results.

    

  
  :type AliasPrefix: string
  :param AliasPrefix: 

    Used to list only contacts who's aliases start with the specified prefix.

    

  
  :type Type: string
  :param Type: 

    The type of contact.

    

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

    
    ::

      {
          'NextToken': 'string',
          'Contacts': [
              {
                  'ContactArn': 'string',
                  'Alias': 'string',
                  'DisplayName': 'string',
                  'Type': 'PERSONAL'|'ESCALATION'|'ONCALL_SCHEDULE'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **NextToken** *(string) --* 

        The pagination token to continue to the next page of results.

        
      

      - **Contacts** *(list) --* 

        A list of the contacts and escalation plans in your Incident Manager account.

        
        

        - *(dict) --* 

          A personal contact or escalation plan that Incident Manager engages during an incident.

          
          

          - **ContactArn** *(string) --* 

            The Amazon Resource Name (ARN) of the contact or escalation plan.

            
          

          - **Alias** *(string) --* 

            The unique and identifiable alias of the contact or escalation plan.

            
          

          - **DisplayName** *(string) --* 

            The full name of the contact or escalation plan.

            
          

          - **Type** *(string) --* 

            The type of contact.

             

            
            * ``PERSONAL``: A single, individual contact.
             
            * ``ESCALATION``: An escalation plan.
             
            * ``ONCALL_SCHEDULE``: An on-call schedule.
            

            
      
    
  
  **Exceptions**
  
  *   :py:class:`SSMContacts.Client.exceptions.AccessDeniedException`

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

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

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

  

  **Examples**

  The following list-contacts example lists the contacts and escalation plans in your account.
  ::

    response = client.list_contacts(
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Contacts': [
            {
                'Alias': 'akuam',
                'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam',
                'DisplayName': 'Akua Mansa',
                'Type': 'PERSONAL',
            },
            {
                'Alias': 'alejr',
                'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/alejr',
                'DisplayName': 'Alejandro Rosalez',
                'Type': 'PERSONAL',
            },
            {
                'Alias': 'anasi',
                'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/anasi',
                'DisplayName': 'Ana Carolina Silva',
                'Type': 'PERSONAL',
            },
            {
                'Alias': 'example_escalation',
                'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation',
                'DisplayName': 'Example Escalation',
                'Type': 'ESCALATION',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  