Skip to content
Start here

Queues

List Queues
GET/accounts/{account_id}/queues
Get Queue
GET/accounts/{account_id}/queues/{queue_id}
Create Queue
POST/accounts/{account_id}/queues
Update Queue
PUT/accounts/{account_id}/queues/{queue_id}
Update Queue
PATCH/accounts/{account_id}/queues/{queue_id}
Delete Queue
DELETE/accounts/{account_id}/queues/{queue_id}
ModelsExpand Collapse
Queue { consumers, consumers_total_count, created_on, 6 more }
consumers: optional array of Consumer
One of the following:
Worker { consumer_id, created_on, dead_letter_queue, 4 more }
consumer_id: optional string

A Resource identifier.

maxLength32
created_on: optional string
formatdate-time
dead_letter_queue: optional string

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

queue_name: optional string
script_name: optional string

Name of a Worker

settings: optional { batch_size, max_concurrency, max_retries, 2 more }
batch_size: optional number

The maximum number of messages to include in a batch.

max_concurrency: optional number

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 number

The maximum number of retries

max_wait_time_ms: optional number

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

retry_delay: optional number

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

type: optional "worker"
HTTPPull { consumer_id, created_on, dead_letter_queue, 3 more }
consumer_id: optional string

A Resource identifier.

maxLength32
created_on: optional string
formatdate-time
dead_letter_queue: optional string

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

queue_name: optional string
settings: optional { batch_size, max_retries, retry_delay, visibility_timeout_ms }
batch_size: optional number

The maximum number of messages to include in a batch.

max_retries: optional number

The maximum number of retries

retry_delay: optional number

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

visibility_timeout_ms: optional number

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

type: optional "http_pull"
consumers_total_count: optional number
created_on: optional string
modified_on: optional string
producers: optional array of { script, type } or { bucket_name, type }
One of the following:
MqWorkerProducer { script, type }
script: optional string
type: optional "worker"
MqR2Producer { bucket_name, type }
bucket_name: optional string
type: optional "r2_bucket"
producers_total_count: optional number
queue_id: optional string
queue_name: optional string
settings: optional { delivery_delay, delivery_paused, message_retention_period }
delivery_delay: optional number

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

delivery_paused: optional boolean

Indicates if message delivery to consumers is currently paused.

message_retention_period: optional number

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

QueueDeleteResponse { errors, messages, success }
errors: optional array of ResponseInfo { code, message, documentation_url, source }
minLength1
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: optional array of string
success: optional true

Indicates if the API call was successful or not.

QueuesMessages

Push Message
POST/accounts/{account_id}/queues/{queue_id}/messages
Acknowledge + Retry Queue Messages
POST/accounts/{account_id}/queues/{queue_id}/messages/ack
Pull Queue Messages
POST/accounts/{account_id}/queues/{queue_id}/messages/pull
Push Message Batch
POST/accounts/{account_id}/queues/{queue_id}/messages/batch
ModelsExpand Collapse
MessagePushResponse { errors, messages, success }
errors: optional array of ResponseInfo { code, message, documentation_url, source }
minLength1
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: optional array of string
success: optional true

Indicates if the API call was successful or not.

MessageAckResponse { ackCount, retryCount, warnings }
ackCount: optional number

The number of messages that were succesfully acknowledged.

retryCount: optional number

The number of messages that were succesfully retried.

warnings: optional array of string
MessagePullResponse { message_backlog_count, messages }
message_backlog_count: optional number

The number of unacknowledged messages in the queue

messages: optional array of { id, attempts, body, 3 more }
id: optional string
attempts: optional number
body: optional string
lease_id: optional string

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 unknown
timestamp_ms: optional number
MessageBulkPushResponse { errors, messages, success }
errors: optional array of ResponseInfo { code, message, documentation_url, source }
minLength1
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: optional array of string
success: optional true

Indicates if the API call was successful or not.

QueuesPurge

Get Queue Purge Status
GET/accounts/{account_id}/queues/{queue_id}/purge
Purge Queue
POST/accounts/{account_id}/queues/{queue_id}/purge
ModelsExpand Collapse
PurgeStatusResponse { completed, started_at }
completed: optional string

Indicates if the last purge operation completed successfully.

started_at: optional string

Timestamp when the last purge operation started.

QueuesConsumers

List Queue Consumers
GET/accounts/{account_id}/queues/{queue_id}/consumers
Get Queue Consumer
GET/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
Create a Queue Consumer
POST/accounts/{account_id}/queues/{queue_id}/consumers
Update Queue Consumer
PUT/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
Delete Queue Consumer
DELETE/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}
ModelsExpand Collapse
Consumer = { consumer_id, created_on, dead_letter_queue, 4 more } or { consumer_id, created_on, dead_letter_queue, 3 more }

Response body representing a consumer

One of the following:
Worker { consumer_id, created_on, dead_letter_queue, 4 more }
consumer_id: optional string

A Resource identifier.

maxLength32
created_on: optional string
formatdate-time
dead_letter_queue: optional string

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

queue_name: optional string
script_name: optional string

Name of a Worker

settings: optional { batch_size, max_concurrency, max_retries, 2 more }
batch_size: optional number

The maximum number of messages to include in a batch.

max_concurrency: optional number

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 number

The maximum number of retries

max_wait_time_ms: optional number

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

retry_delay: optional number

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

type: optional "worker"
HTTPPull { consumer_id, created_on, dead_letter_queue, 3 more }
consumer_id: optional string

A Resource identifier.

maxLength32
created_on: optional string
formatdate-time
dead_letter_queue: optional string

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

queue_name: optional string
settings: optional { batch_size, max_retries, retry_delay, visibility_timeout_ms }
batch_size: optional number

The maximum number of messages to include in a batch.

max_retries: optional number

The maximum number of retries

retry_delay: optional number

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

visibility_timeout_ms: optional number

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

type: optional "http_pull"
ConsumerDeleteResponse { errors, messages, success }
errors: optional array of ResponseInfo { code, message, documentation_url, source }
minLength1
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: optional array of string
success: optional true

Indicates if the API call was successful or not.

QueuesSubscriptions

List Event Subscriptions
GET/accounts/{account_id}/event_subscriptions/subscriptions
Get Event Subscription
GET/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}
Create Event Subscription
POST/accounts/{account_id}/event_subscriptions/subscriptions
Update Event Subscription
PATCH/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}
Delete Event Subscription
DELETE/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}
ModelsExpand Collapse
SubscriptionListResponse { id, created_at, destination, 5 more }
id: string

Unique identifier for the subscription

created_at: string

When the subscription was created

formatdate-time
destination: { queue_id, type }

Destination configuration for the subscription

queue_id: string

ID of the target queue

type: "queues.queue"

Type of destination

enabled: boolean

Whether the subscription is active

events: array of string

List of event types this subscription handles

modified_at: string

When the subscription was last modified

formatdate-time
name: string

Name of the subscription

source: { type } or { type } or { type } or 5 more

Source configuration for the subscription

One of the following:
MqEventSourceImages { type }
type: optional "images"

Type of source

MqEventSourceKV { type }
type: optional "kv"

Type of source

MqEventSourceR2 { type }
type: optional "r2"

Type of source

MqEventSourceSuperSlurper { type }
type: optional "superSlurper"

Type of source

MqEventSourceVectorize { type }
type: optional "vectorize"

Type of source

MqEventSourceWorkersAIModel { model_name, type }
model_name: optional string

Name of the Workers AI model

type: optional "workersAi.model"

Type of source

MqEventSourceWorkersBuildsWorker { type, worker_name }
type: optional "workersBuilds.worker"

Type of source

worker_name: optional string

Name of the worker

MqEventSourceWorkflowsWorkflow { type, workflow_name }
type: optional "workflows.workflow"

Type of source

workflow_name: optional string

Name of the workflow

SubscriptionGetResponse { id, created_at, destination, 5 more }
id: string

Unique identifier for the subscription

created_at: string

When the subscription was created

formatdate-time
destination: { queue_id, type }

Destination configuration for the subscription

queue_id: string

ID of the target queue

type: "queues.queue"

Type of destination

enabled: boolean

Whether the subscription is active

events: array of string

List of event types this subscription handles

modified_at: string

When the subscription was last modified

formatdate-time
name: string

Name of the subscription

source: { type } or { type } or { type } or 5 more

Source configuration for the subscription

One of the following:
MqEventSourceImages { type }
type: optional "images"

Type of source

MqEventSourceKV { type }
type: optional "kv"

Type of source

MqEventSourceR2 { type }
type: optional "r2"

Type of source

MqEventSourceSuperSlurper { type }
type: optional "superSlurper"

Type of source

MqEventSourceVectorize { type }
type: optional "vectorize"

Type of source

MqEventSourceWorkersAIModel { model_name, type }
model_name: optional string

Name of the Workers AI model

type: optional "workersAi.model"

Type of source

MqEventSourceWorkersBuildsWorker { type, worker_name }
type: optional "workersBuilds.worker"

Type of source

worker_name: optional string

Name of the worker

MqEventSourceWorkflowsWorkflow { type, workflow_name }
type: optional "workflows.workflow"

Type of source

workflow_name: optional string

Name of the workflow

SubscriptionCreateResponse { id, created_at, destination, 5 more }
id: string

Unique identifier for the subscription

created_at: string

When the subscription was created

formatdate-time
destination: { queue_id, type }

Destination configuration for the subscription

queue_id: string

ID of the target queue

type: "queues.queue"

Type of destination

enabled: boolean

Whether the subscription is active

events: array of string

List of event types this subscription handles

modified_at: string

When the subscription was last modified

formatdate-time
name: string

Name of the subscription

source: { type } or { type } or { type } or 5 more

Source configuration for the subscription

One of the following:
MqEventSourceImages { type }
type: optional "images"

Type of source

MqEventSourceKV { type }
type: optional "kv"

Type of source

MqEventSourceR2 { type }
type: optional "r2"

Type of source

MqEventSourceSuperSlurper { type }
type: optional "superSlurper"

Type of source

MqEventSourceVectorize { type }
type: optional "vectorize"

Type of source

MqEventSourceWorkersAIModel { model_name, type }
model_name: optional string

Name of the Workers AI model

type: optional "workersAi.model"

Type of source

MqEventSourceWorkersBuildsWorker { type, worker_name }
type: optional "workersBuilds.worker"

Type of source

worker_name: optional string

Name of the worker

MqEventSourceWorkflowsWorkflow { type, workflow_name }
type: optional "workflows.workflow"

Type of source

workflow_name: optional string

Name of the workflow

SubscriptionUpdateResponse { id, created_at, destination, 5 more }
id: string

Unique identifier for the subscription

created_at: string

When the subscription was created

formatdate-time
destination: { queue_id, type }

Destination configuration for the subscription

queue_id: string

ID of the target queue

type: "queues.queue"

Type of destination

enabled: boolean

Whether the subscription is active

events: array of string

List of event types this subscription handles

modified_at: string

When the subscription was last modified

formatdate-time
name: string

Name of the subscription

source: { type } or { type } or { type } or 5 more

Source configuration for the subscription

One of the following:
MqEventSourceImages { type }
type: optional "images"

Type of source

MqEventSourceKV { type }
type: optional "kv"

Type of source

MqEventSourceR2 { type }
type: optional "r2"

Type of source

MqEventSourceSuperSlurper { type }
type: optional "superSlurper"

Type of source

MqEventSourceVectorize { type }
type: optional "vectorize"

Type of source

MqEventSourceWorkersAIModel { model_name, type }
model_name: optional string

Name of the Workers AI model

type: optional "workersAi.model"

Type of source

MqEventSourceWorkersBuildsWorker { type, worker_name }
type: optional "workersBuilds.worker"

Type of source

worker_name: optional string

Name of the worker

MqEventSourceWorkflowsWorkflow { type, workflow_name }
type: optional "workflows.workflow"

Type of source

workflow_name: optional string

Name of the workflow

SubscriptionDeleteResponse { id, created_at, destination, 5 more }
id: string

Unique identifier for the subscription

created_at: string

When the subscription was created

formatdate-time
destination: { queue_id, type }

Destination configuration for the subscription

queue_id: string

ID of the target queue

type: "queues.queue"

Type of destination

enabled: boolean

Whether the subscription is active

events: array of string

List of event types this subscription handles

modified_at: string

When the subscription was last modified

formatdate-time
name: string

Name of the subscription

source: { type } or { type } or { type } or 5 more

Source configuration for the subscription

One of the following:
MqEventSourceImages { type }
type: optional "images"

Type of source

MqEventSourceKV { type }
type: optional "kv"

Type of source

MqEventSourceR2 { type }
type: optional "r2"

Type of source

MqEventSourceSuperSlurper { type }
type: optional "superSlurper"

Type of source

MqEventSourceVectorize { type }
type: optional "vectorize"

Type of source

MqEventSourceWorkersAIModel { model_name, type }
model_name: optional string

Name of the Workers AI model

type: optional "workersAi.model"

Type of source

MqEventSourceWorkersBuildsWorker { type, worker_name }
type: optional "workersBuilds.worker"

Type of source

worker_name: optional string

Name of the worker

MqEventSourceWorkflowsWorkflow { type, workflow_name }
type: optional "workflows.workflow"

Type of source

workflow_name: optional string

Name of the workflow