Skip to content
Start here

List Queues

queues.list(QueueListParams**kwargs) -> SyncSinglePage[Queue]
GET/accounts/{account_id}/queues

Returns the queues owned by an account.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Queues WriteQueues ReadWorkers Scripts WriteWorkers Scripts Read
ParametersExpand Collapse
account_id: str

A Resource identifier.

maxLength32
ReturnsExpand Collapse
class Queue:
consumers: Optional[List[Consumer]]
One of the following:
class MqWorkerConsumerResponse:
consumer_id: Optional[str]

A Resource identifier.

maxLength32
created_on: Optional[datetime]
formatdate-time
dead_letter_queue: Optional[str]

Name of the dead letter queue, or empty string if not configured

queue_name: Optional[str]
script_name: Optional[str]

Name of a Worker

settings: Optional[MqWorkerConsumerResponseSettings]
batch_size: Optional[float]

The maximum number of messages to include in a batch.

max_concurrency: Optional[float]

Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).

max_retries: Optional[float]

The maximum number of retries

max_wait_time_ms: Optional[float]

The number of milliseconds to wait for a batch to fill up before attempting to deliver it

retry_delay: Optional[float]

The number of seconds to delay before making the message available for another attempt.

type: Optional[Literal["worker"]]
class MqHTTPConsumerResponse:
consumer_id: Optional[str]

A Resource identifier.

maxLength32
created_on: Optional[datetime]
formatdate-time
dead_letter_queue: Optional[str]

Name of the dead letter queue, or empty string if not configured

queue_name: Optional[str]
settings: Optional[MqHTTPConsumerResponseSettings]
batch_size: Optional[float]

The maximum number of messages to include in a batch.

max_retries: Optional[float]

The maximum number of retries

retry_delay: Optional[float]

The number of seconds to delay before making the message available for another attempt.

visibility_timeout_ms: Optional[float]

The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.

type: Optional[Literal["http_pull"]]
consumers_total_count: Optional[float]
created_on: Optional[str]
modified_on: Optional[str]
producers: Optional[List[Producer]]
One of the following:
class ProducerMqWorkerProducer:
script: Optional[str]
type: Optional[Literal["worker"]]
class ProducerMqR2Producer:
bucket_name: Optional[str]
type: Optional[Literal["r2_bucket"]]
producers_total_count: Optional[float]
queue_id: Optional[str]
queue_name: Optional[str]
settings: Optional[Settings]
delivery_delay: Optional[float]

Number of seconds to delay delivery of all messages to consumers.

delivery_paused: Optional[bool]

Indicates if message delivery to consumers is currently paused.

message_retention_period: Optional[float]

Number of seconds after which an unconsumed message will be delayed.

List Queues

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.queues.list(
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result[0]
print(page.queue_id)
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": [
    {
      "consumers": [
        {
          "consumer_id": "023e105f4ecef8ad9ca31a8372d0c353",
          "created_on": "2019-12-27T18:11:19.117Z",
          "dead_letter_queue": "dead_letter_queue",
          "queue_name": "example-queue",
          "script_name": "my-consumer-worker",
          "settings": {
            "batch_size": 50,
            "max_concurrency": 10,
            "max_retries": 3,
            "max_wait_time_ms": 5000,
            "retry_delay": 10
          },
          "type": "worker"
        }
      ],
      "consumers_total_count": 0,
      "created_on": "created_on",
      "modified_on": "modified_on",
      "producers": [
        {
          "script": "script",
          "type": "worker"
        }
      ],
      "producers_total_count": 0,
      "queue_id": "queue_id",
      "queue_name": "example-queue",
      "settings": {
        "delivery_delay": 5,
        "delivery_paused": true,
        "message_retention_period": 345600
      }
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": [
    {
      "consumers": [
        {
          "consumer_id": "023e105f4ecef8ad9ca31a8372d0c353",
          "created_on": "2019-12-27T18:11:19.117Z",
          "dead_letter_queue": "dead_letter_queue",
          "queue_name": "example-queue",
          "script_name": "my-consumer-worker",
          "settings": {
            "batch_size": 50,
            "max_concurrency": 10,
            "max_retries": 3,
            "max_wait_time_ms": 5000,
            "retry_delay": 10
          },
          "type": "worker"
        }
      ],
      "consumers_total_count": 0,
      "created_on": "created_on",
      "modified_on": "modified_on",
      "producers": [
        {
          "script": "script",
          "type": "worker"
        }
      ],
      "producers_total_count": 0,
      "queue_id": "queue_id",
      "queue_name": "example-queue",
      "settings": {
        "delivery_delay": 5,
        "delivery_paused": true,
        "message_retention_period": 345600
      }
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  },
  "success": true
}