---
title: Messages
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Queues](https://developers.cloudflare.com/api/typescript/resources/queues)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Messages

##### [Push Message](https://developers.cloudflare.com/api/typescript/resources/queues/subresources/messages/methods/push)

client.queues.messages.push(stringqueueID, MessagePushParamsparams, RequestOptionsoptions?): [MessagePushResponse](<https://developers.cloudflare.com/api/typescript/resources/queues#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)>) {metadata }

POST/accounts/{account\_id}/queues/{queue\_id}/messages

##### [Acknowledge + Retry Queue Messages](https://developers.cloudflare.com/api/typescript/resources/queues/subresources/messages/methods/ack)

client.queues.messages.ack(stringqueueID, MessageAckParams {account\_id, acks, retries } params, RequestOptionsoptions?): [MessageAckResponse](<https://developers.cloudflare.com/api/typescript/resources/queues#(resource)%20queues.messages%20%3E%20(model)%20message_ack_response%20%3E%20(schema)>) {ackCount, retryCount, warnings }

POST/accounts/{account\_id}/queues/{queue\_id}/messages/ack

##### [Pull Queue Messages](https://developers.cloudflare.com/api/typescript/resources/queues/subresources/messages/methods/pull)

client.queues.messages.pull(stringqueueID, MessagePullParams {account\_id, batch\_size, visibility\_timeout\_ms } params, RequestOptionsoptions?): [MessagePullResponse](<https://developers.cloudflare.com/api/typescript/resources/queues#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)>) {message\_backlog\_count, messages, metadata }

POST/accounts/{account\_id}/queues/{queue\_id}/messages/pull

##### [Push Message Batch](https://developers.cloudflare.com/api/typescript/resources/queues/subresources/messages/methods/bulk_push)

client.queues.messages.bulkPush(stringqueueID, MessageBulkPushParams {account\_id, delay\_seconds, messages } params, RequestOptionsoptions?): [MessageBulkPushResponse](<https://developers.cloudflare.com/api/typescript/resources/queues#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)>) {metadata }

POST/accounts/{account\_id}/queues/{queue\_id}/messages/batch

##### [Peek Queue Messages](https://developers.cloudflare.com/api/typescript/resources/queues/subresources/messages/methods/peek)

client.queues.messages.peek(stringqueueID, MessagePeekParams {account\_id, batch\_size } params, RequestOptionsoptions?): [MessagePeekResponse](<https://developers.cloudflare.com/api/typescript/resources/queues#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)>) {messages }

POST/accounts/{account\_id}/queues/{queue\_id}/messages/peek

##### [Purge Peeked Queue Messages](https://developers.cloudflare.com/api/typescript/resources/queues/subresources/messages/methods/purge)

client.queues.messages.purge(stringqueueID, MessagePurgeParams {account\_id, refs } params, RequestOptionsoptions?): [MessagePurgeResponse](<https://developers.cloudflare.com/api/typescript/resources/queues#(resource)%20queues.messages%20%3E%20(model)%20message_purge_response%20%3E%20(schema)>) {errors, warnings }

POST/accounts/{account\_id}/queues/{queue\_id}/messages/purge

##### ModelsExpand Collapse

<details>

<summary>

MessagePushResponse {metadata }

</summary>

<details>

<summary>

metadata?: Metadata {metrics }

</summary>

<details>

<summary>

metrics?: Metrics {backlog\_bytes, backlog\_count, oldest\_message\_timestamp\_ms }

Best-effort metrics for the queue. Values may be approximate due to the distributed nature of queues.

</summary>

backlog\_bytes: number

The size in bytes of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20backlog_bytes">Link to this property</a>

backlog\_count: number

The number of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20backlog_count">Link to this property</a>

oldest\_message\_timestamp\_ms: number

Unix timestamp in milliseconds of the oldest unacknowledged message in the queue. Returns 0 if unknown.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20oldest_message_timestamp_ms">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata">Link to this property</a>

</details>

[Link to this property](<#(resource)%20queues.messages%20%3E%20(model)%20message_push_response%20%3E%20(schema)>)

<details>

<summary>

MessageAckResponse {ackCount, retryCount, warnings }

</summary>

ackCount?: number

The number of messages that were succesfully acknowledged.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_ack_response%20%3E%20(schema)%20%3E%20(property)%20ackCount">Link to this property</a>

retryCount?: number

The number of messages that were succesfully retried.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_ack_response%20%3E%20(schema)%20%3E%20(property)%20retryCount">Link to this property</a>

warnings?: Record&lt;string, string&gt;

Map of lease IDs to warning messages encountered during acknowledgement.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_ack_response%20%3E%20(schema)%20%3E%20(property)%20warnings">Link to this property</a>

</details>

[Link to this property](<#(resource)%20queues.messages%20%3E%20(model)%20message_ack_response%20%3E%20(schema)>)

<details>

<summary>

MessagePullResponse {message\_backlog\_count, messages, metadata }

</summary>

message\_backlog\_count?: number

The number of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20message_backlog_count">Link to this property</a>

<details>

<summary>

messages?: Array&lt;Message&gt;

</summary>

id?: string

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20id">Link to this property</a>

attempts?: number

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20attempts">Link to this property</a>

body?: string

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20body">Link to this property</a>

lease\_id?: 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.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20lease_id">Link to this property</a>

metadata?: unknown

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20metadata">Link to this property</a>

timestamp\_ms?: number

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20timestamp_ms">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20messages">Link to this property</a>

<details>

<summary>

metadata?: Metadata {metrics }

</summary>

<details>

<summary>

metrics?: Metrics {backlog\_bytes, backlog\_count, oldest\_message\_timestamp\_ms }

Best-effort metrics for the queue. Values may be approximate due to the distributed nature of queues.

</summary>

backlog\_bytes: number

The size in bytes of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20backlog_bytes">Link to this property</a>

backlog\_count: number

The number of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20backlog_count">Link to this property</a>

oldest\_message\_timestamp\_ms: number

Unix timestamp in milliseconds of the oldest unacknowledged message in the queue. Returns 0 if unknown.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20oldest_message_timestamp_ms">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)%20%3E%20(property)%20metadata">Link to this property</a>

</details>

[Link to this property](<#(resource)%20queues.messages%20%3E%20(model)%20message_pull_response%20%3E%20(schema)>)

<details>

<summary>

MessageBulkPushResponse {metadata }

</summary>

<details>

<summary>

metadata?: Metadata {metrics }

</summary>

<details>

<summary>

metrics?: Metrics {backlog\_bytes, backlog\_count, oldest\_message\_timestamp\_ms }

Best-effort metrics for the queue. Values may be approximate due to the distributed nature of queues.

</summary>

backlog\_bytes: number

The size in bytes of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20backlog_bytes">Link to this property</a>

backlog\_count: number

The number of unacknowledged messages in the queue.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20backlog_count">Link to this property</a>

oldest\_message\_timestamp\_ms: number

Unix timestamp in milliseconds of the oldest unacknowledged message in the queue. Returns 0 if unknown.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics%20%3E%20(property)%20oldest_message_timestamp_ms">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata%20%3E%20(property)%20metrics">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)%20%3E%20(property)%20metadata">Link to this property</a>

</details>

[Link to this property](<#(resource)%20queues.messages%20%3E%20(model)%20message_bulk_push_response%20%3E%20(schema)>)

<details>

<summary>

MessagePeekResponse {messages }

</summary>

<details>

<summary>

messages?: Array&lt;Message&gt;

</summary>

id?: string

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20id">Link to this property</a>

attempts?: number

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20attempts">Link to this property</a>

body?: string

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20body">Link to this property</a>

metadata?: unknown

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20metadata">Link to this property</a>

ref?: string

An opaque reference to a peeked message. You must hold on to this value and use it to purge the message.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20ref">Link to this property</a>

timestamp\_ms?: number

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20timestamp_ms">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)%20%3E%20(property)%20messages">Link to this property</a>

</details>

[Link to this property](<#(resource)%20queues.messages%20%3E%20(model)%20message_peek_response%20%3E%20(schema)>)

<details>

<summary>

MessagePurgeResponse {errors, warnings }

</summary>

<details>

<summary>

errors?: Array&lt;Error&gt;

Errors encountered while purging messages.

</summary>

message?: string

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_purge_response%20%3E%20(schema)%20%3E%20(property)%20errors%20%3E%20(items)%20%3E%20(property)%20message">Link to this property</a>

</details>

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_purge_response%20%3E%20(schema)%20%3E%20(property)%20errors">Link to this property</a>

warnings?: Record&lt;string, string&gt;

Map of refs to warning messages encountered during purge.

<a href="#(resource)%20queues.messages%20%3E%20(model)%20message_purge_response%20%3E%20(schema)%20%3E%20(property)%20warnings">Link to this property</a>

</details>

[Link to this property](<#(resource)%20queues.messages%20%3E%20(model)%20message_purge_response%20%3E%20(schema)>)