Skip to content
Start here

Queues

List Queues
queues.list(QueueListParams**kwargs) -> SyncSinglePage[Queue]
GET/accounts/{account_id}/queues
Get Queue
queues.get(strqueue_id, QueueGetParams**kwargs) -> Queue
GET/accounts/{account_id}/queues/{queue_id}
Create Queue
queues.create(QueueCreateParams**kwargs) -> Queue
POST/accounts/{account_id}/queues
Update Queue
queues.update(strqueue_id, QueueUpdateParams**kwargs) -> Queue
PUT/accounts/{account_id}/queues/{queue_id}
Update Queue
queues.edit(strqueue_id, QueueEditParams**kwargs) -> Queue
PATCH/accounts/{account_id}/queues/{queue_id}
Delete Queue
queues.delete(strqueue_id, QueueDeleteParams**kwargs) -> QueueDeleteResponse
DELETE/accounts/{account_id}/queues/{queue_id}
ModelsExpand 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.

class QueueDeleteResponse:
errors: Optional[List[ResponseInfo]]
minLength1
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[Source]
pointer: Optional[str]
messages: Optional[List[str]]
success: Optional[Literal[true]]

Indicates if the API call was successful or not.

QueuesMessages

Push Message
queues.messages.push(strqueue_id, MessagePushParams**kwargs) -> MessagePushResponse
POST/accounts/{account_id}/queues/{queue_id}/messages
Acknowledge + Retry Queue Messages
queues.messages.ack(strqueue_id, MessageAckParams**kwargs) -> MessageAckResponse
POST/accounts/{account_id}/queues/{queue_id}/messages/ack
Pull Queue Messages
queues.messages.pull(strqueue_id, MessagePullParams**kwargs) -> MessagePullResponse
POST/accounts/{account_id}/queues/{queue_id}/messages/pull
Push Message Batch
queues.messages.bulk_push(strqueue_id, MessageBulkPushParams**kwargs) -> MessageBulkPushResponse
POST/accounts/{account_id}/queues/{queue_id}/messages/batch
ModelsExpand Collapse
class MessagePushResponse:
errors: Optional[List[ResponseInfo]]
minLength1
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[Source]
pointer: Optional[str]
messages: Optional[List[str]]
success: Optional[Literal[true]]

Indicates if the API call was successful or not.

class MessageAckResponse:
ack_count: Optional[float]

The number of messages that were succesfully acknowledged.

retry_count: Optional[float]

The number of messages that were succesfully retried.

warnings: Optional[List[str]]
class MessagePullResponse:
message_backlog_count: Optional[float]

The number of unacknowledged messages in the queue

messages: Optional[List[Message]]
id: Optional[str]
attempts: Optional[float]
body: Optional[str]
lease_id: Optional[str]

An ID that represents an "in-flight" message that has been pulled from a Queue. You must hold on to this ID and use it to acknowledge this message.

metadata: Optional[object]
timestamp_ms: Optional[float]
class MessageBulkPushResponse:
errors: Optional[List[ResponseInfo]]
minLength1
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[Source]
pointer: Optional[str]
messages: Optional[List[str]]
success: Optional[Literal[true]]

Indicates if the API call was successful or not.

QueuesPurge

Get Queue Purge Status
queues.purge.status(strqueue_id, PurgeStatusParams**kwargs) -> PurgeStatusResponse
GET/accounts/{account_id}/queues/{queue_id}/purge
Purge Queue
queues.purge.start(strqueue_id, PurgeStartParams**kwargs) -> Queue
POST/accounts/{account_id}/queues/{queue_id}/purge
ModelsExpand Collapse
class PurgeStatusResponse:
completed: Optional[str]

Indicates if the last purge operation completed successfully.

started_at: Optional[str]

Timestamp when the last purge operation started.

QueuesConsumers

List Queue Consumers
queues.consumers.list(strqueue_id, ConsumerListParams**kwargs) -> SyncSinglePage[Consumer]
GET/accounts/{account_id}/queues/{queue_id}/consumers
Get Queue Consumer
queues.consumers.get(strconsumer_id, ConsumerGetParams**kwargs) -> Consumer
GET/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
Create a Queue Consumer
queues.consumers.create(strqueue_id, ConsumerCreateParams**kwargs) -> Consumer
POST/accounts/{account_id}/queues/{queue_id}/consumers
Update Queue Consumer
queues.consumers.update(strconsumer_id, ConsumerUpdateParams**kwargs) -> Consumer
PUT/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
Delete Queue Consumer
queues.consumers.delete(strconsumer_id, ConsumerDeleteParams**kwargs) -> ConsumerDeleteResponse
DELETE/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
ModelsExpand Collapse

Response body representing a 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"]]
class ConsumerDeleteResponse:
errors: Optional[List[ResponseInfo]]
minLength1
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[Source]
pointer: Optional[str]
messages: Optional[List[str]]
success: Optional[Literal[true]]

Indicates if the API call was successful or not.

QueuesSubscriptions

List Event Subscriptions
queues.subscriptions.list(SubscriptionListParams**kwargs) -> SyncV4PagePaginationArray[SubscriptionListResponse]
GET/accounts/{account_id}/event_subscriptions/subscriptions
Get Event Subscription
queues.subscriptions.get(strsubscription_id, SubscriptionGetParams**kwargs) -> SubscriptionGetResponse
GET/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}
Create Event Subscription
queues.subscriptions.create(SubscriptionCreateParams**kwargs) -> SubscriptionCreateResponse
POST/accounts/{account_id}/event_subscriptions/subscriptions
Update Event Subscription
queues.subscriptions.update(strsubscription_id, SubscriptionUpdateParams**kwargs) -> SubscriptionUpdateResponse
PATCH/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}
Delete Event Subscription
queues.subscriptions.delete(strsubscription_id, SubscriptionDeleteParams**kwargs) -> SubscriptionDeleteResponse
DELETE/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}
ModelsExpand Collapse
class SubscriptionListResponse:
id: str

Unique identifier for the subscription

created_at: datetime

When the subscription was created

formatdate-time
destination: Destination

Destination configuration for the subscription

queue_id: str

ID of the target queue

type: Literal["queues.queue"]

Type of destination

enabled: bool

Whether the subscription is active

events: List[str]

List of event types this subscription handles

modified_at: datetime

When the subscription was last modified

formatdate-time
name: str

Name of the subscription

source: Source

Source configuration for the subscription

One of the following:
class SourceMqEventSourceImages:
type: Optional[Literal["images"]]

Type of source

class SourceMqEventSourceKV:
type: Optional[Literal["kv"]]

Type of source

class SourceMqEventSourceR2:
type: Optional[Literal["r2"]]

Type of source

class SourceMqEventSourceSuperSlurper:
type: Optional[Literal["superSlurper"]]

Type of source

class SourceMqEventSourceVectorize:
type: Optional[Literal["vectorize"]]

Type of source

class SourceMqEventSourceWorkersAIModel:
model_name: Optional[str]

Name of the Workers AI model

type: Optional[Literal["workersAi.model"]]

Type of source

class SourceMqEventSourceWorkersBuildsWorker:
type: Optional[Literal["workersBuilds.worker"]]

Type of source

worker_name: Optional[str]

Name of the worker

class SourceMqEventSourceWorkflowsWorkflow:
type: Optional[Literal["workflows.workflow"]]

Type of source

workflow_name: Optional[str]

Name of the workflow

class SubscriptionGetResponse:
id: str

Unique identifier for the subscription

created_at: datetime

When the subscription was created

formatdate-time
destination: Destination

Destination configuration for the subscription

queue_id: str

ID of the target queue

type: Literal["queues.queue"]

Type of destination

enabled: bool

Whether the subscription is active

events: List[str]

List of event types this subscription handles

modified_at: datetime

When the subscription was last modified

formatdate-time
name: str

Name of the subscription

source: Source

Source configuration for the subscription

One of the following:
class SourceMqEventSourceImages:
type: Optional[Literal["images"]]

Type of source

class SourceMqEventSourceKV:
type: Optional[Literal["kv"]]

Type of source

class SourceMqEventSourceR2:
type: Optional[Literal["r2"]]

Type of source

class SourceMqEventSourceSuperSlurper:
type: Optional[Literal["superSlurper"]]

Type of source

class SourceMqEventSourceVectorize:
type: Optional[Literal["vectorize"]]

Type of source

class SourceMqEventSourceWorkersAIModel:
model_name: Optional[str]

Name of the Workers AI model

type: Optional[Literal["workersAi.model"]]

Type of source

class SourceMqEventSourceWorkersBuildsWorker:
type: Optional[Literal["workersBuilds.worker"]]

Type of source

worker_name: Optional[str]

Name of the worker

class SourceMqEventSourceWorkflowsWorkflow:
type: Optional[Literal["workflows.workflow"]]

Type of source

workflow_name: Optional[str]

Name of the workflow

class SubscriptionCreateResponse:
id: str

Unique identifier for the subscription

created_at: datetime

When the subscription was created

formatdate-time
destination: Destination

Destination configuration for the subscription

queue_id: str

ID of the target queue

type: Literal["queues.queue"]

Type of destination

enabled: bool

Whether the subscription is active

events: List[str]

List of event types this subscription handles

modified_at: datetime

When the subscription was last modified

formatdate-time
name: str

Name of the subscription

source: Source

Source configuration for the subscription

One of the following:
class SourceMqEventSourceImages:
type: Optional[Literal["images"]]

Type of source

class SourceMqEventSourceKV:
type: Optional[Literal["kv"]]

Type of source

class SourceMqEventSourceR2:
type: Optional[Literal["r2"]]

Type of source

class SourceMqEventSourceSuperSlurper:
type: Optional[Literal["superSlurper"]]

Type of source

class SourceMqEventSourceVectorize:
type: Optional[Literal["vectorize"]]

Type of source

class SourceMqEventSourceWorkersAIModel:
model_name: Optional[str]

Name of the Workers AI model

type: Optional[Literal["workersAi.model"]]

Type of source

class SourceMqEventSourceWorkersBuildsWorker:
type: Optional[Literal["workersBuilds.worker"]]

Type of source

worker_name: Optional[str]

Name of the worker

class SourceMqEventSourceWorkflowsWorkflow:
type: Optional[Literal["workflows.workflow"]]

Type of source

workflow_name: Optional[str]

Name of the workflow

class SubscriptionUpdateResponse:
id: str

Unique identifier for the subscription

created_at: datetime

When the subscription was created

formatdate-time
destination: Destination

Destination configuration for the subscription

queue_id: str

ID of the target queue

type: Literal["queues.queue"]

Type of destination

enabled: bool

Whether the subscription is active

events: List[str]

List of event types this subscription handles

modified_at: datetime

When the subscription was last modified

formatdate-time
name: str

Name of the subscription

source: Source

Source configuration for the subscription

One of the following:
class SourceMqEventSourceImages:
type: Optional[Literal["images"]]

Type of source

class SourceMqEventSourceKV:
type: Optional[Literal["kv"]]

Type of source

class SourceMqEventSourceR2:
type: Optional[Literal["r2"]]

Type of source

class SourceMqEventSourceSuperSlurper:
type: Optional[Literal["superSlurper"]]

Type of source

class SourceMqEventSourceVectorize:
type: Optional[Literal["vectorize"]]

Type of source

class SourceMqEventSourceWorkersAIModel:
model_name: Optional[str]

Name of the Workers AI model

type: Optional[Literal["workersAi.model"]]

Type of source

class SourceMqEventSourceWorkersBuildsWorker:
type: Optional[Literal["workersBuilds.worker"]]

Type of source

worker_name: Optional[str]

Name of the worker

class SourceMqEventSourceWorkflowsWorkflow:
type: Optional[Literal["workflows.workflow"]]

Type of source

workflow_name: Optional[str]

Name of the workflow

class SubscriptionDeleteResponse:
id: str

Unique identifier for the subscription

created_at: datetime

When the subscription was created

formatdate-time
destination: Destination

Destination configuration for the subscription

queue_id: str

ID of the target queue

type: Literal["queues.queue"]

Type of destination

enabled: bool

Whether the subscription is active

events: List[str]

List of event types this subscription handles

modified_at: datetime

When the subscription was last modified

formatdate-time
name: str

Name of the subscription

source: Source

Source configuration for the subscription

One of the following:
class SourceMqEventSourceImages:
type: Optional[Literal["images"]]

Type of source

class SourceMqEventSourceKV:
type: Optional[Literal["kv"]]

Type of source

class SourceMqEventSourceR2:
type: Optional[Literal["r2"]]

Type of source

class SourceMqEventSourceSuperSlurper:
type: Optional[Literal["superSlurper"]]

Type of source

class SourceMqEventSourceVectorize:
type: Optional[Literal["vectorize"]]

Type of source

class SourceMqEventSourceWorkersAIModel:
model_name: Optional[str]

Name of the Workers AI model

type: Optional[Literal["workersAi.model"]]

Type of source

class SourceMqEventSourceWorkersBuildsWorker:
type: Optional[Literal["workersBuilds.worker"]]

Type of source

worker_name: Optional[str]

Name of the worker

class SourceMqEventSourceWorkflowsWorkflow:
type: Optional[Literal["workflows.workflow"]]

Type of source

workflow_name: Optional[str]

Name of the workflow