:doc:`SQS <../../sqs>` / Client / list_queues

***********
list_queues
***********



.. py:method:: SQS.Client.list_queues(**kwargs)

  

  Returns a list of your queues in the current region. The response includes a maximum of 1,000 results. If you specify a value for the optional ``QueueNamePrefix`` parameter, only queues with a name that begins with the specified value are returned.

   

  The ``listQueues`` methods supports pagination. Set parameter ``MaxResults`` in the request to specify the maximum number of results to be returned in the response. If you do not set ``MaxResults``, the response includes a maximum of 1,000 results. If you set ``MaxResults`` and there are additional results to display, the response includes a value for ``NextToken``. Use ``NextToken`` as a parameter in your next request to ``listQueues`` to receive the next page of results.

   

  .. note::

    

    Cross-account permissions don't apply to this action. For more information, see `Grant cross-account permissions to a role and a username <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name>`__ in the *Amazon SQS Developer Guide*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues>`_  


  **Request Syntax**
  ::

    response = client.list_queues(
        QueueNamePrefix='string',
        NextToken='string',
        MaxResults=123
    )
    
  :type QueueNamePrefix: string
  :param QueueNamePrefix: 

    A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.

     

    Queue URLs and names are case-sensitive.

    

  
  :type NextToken: string
  :param NextToken: 

    Pagination token to request the next set of results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    Maximum number of results to include in the response. Value range is 1 to 1000. You must set ``MaxResults`` to receive a value for ``NextToken`` in the response.

    

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

    
    ::

      {
          'QueueUrls': [
              'string',
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      A list of your queues.

      
      

      - **QueueUrls** *(list) --* 

        A list of queue URLs, up to 1,000 entries, or the value of ``MaxResults`` that you sent in the request.

        
        

        - *(string) --* 
    
      

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

        Pagination token to include in the next request. Token value is ``null`` if there are no additional results to request, or if you did not set ``MaxResults`` in the request.

        
  
  **Exceptions**
  
  *   :py:class:`SQS.Client.exceptions.RequestThrottled`

  
  *   :py:class:`SQS.Client.exceptions.InvalidSecurity`

  
  *   :py:class:`SQS.Client.exceptions.InvalidAddress`

  
  *   :py:class:`SQS.Client.exceptions.UnsupportedOperation`

  