Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Message Queue
  • Access management
  • Pricing policy
  • Terraform reference
    • Overview
      • ChangeMessageVisibility
      • ChangeMessageVisibilityBatch
      • DeleteMessage
      • DeleteMessageBatch
      • ReceiveMessage
      • SendMessage
      • SendMessageBatch
    • Common errors
  • Monitoring metrics
  • Public materials
  • FAQ

In this article:

  • Request
  • Request parameters
  • Response
  • Successful response fields
  • DeleteMessageBatch errors
  • Sample request
  • Response example
  1. API reference
  2. Message
  3. DeleteMessageBatch

DeleteMessageBatch

Written by
Yandex Cloud
Updated at October 4, 2024
  • Request
    • Request parameters
  • Response
    • Successful response fields
    • DeleteMessageBatch errors
  • Sample request
  • Response example

Method for deleting multiple messages from a queue. You can delete up to 10 messages at once.

The result of changing each message's visibility timeout is reported individually in the response. Since deleting a message may either succeed or fail, make sure to check all results, even if code 200 is returned in response to the DeleteMessageBatch method call.

RequestRequest

Request parametersRequest parameters

Parameter Type Required parameter Description
QueueUrl string Yes URL of the queue where the message is placed.
DeleteMessageBatchRequestEntry.N array Yes The DeleteMessageBatchRequestEntry array that contains the ReceiptHandle parameters of the messages to delete.

ResponseResponse

Successful response fieldsSuccessful response fields

Field Type Description
BatchResultErrorEntry.N array The BatchResultErrorEntry array that contains request execution errors.
DeleteMessageBatchResultEntry.N array The DeleteMessageBatchResultEntry array with the IDs of the messages that have been deleted.

DeleteMessageBatch errorsDeleteMessageBatch errors

For a list of errors common for all methods, see Common errors.

HTTP code Error ID Description
400 BatchEntryIdsNotDistinct Two or more batch entries in the request have the same ID.
400 EmptyBatchRequest The batch request does not contain any entries.
400 InvalidBatchEntryId The ID of a batch entry is invalid.
400 TooManyEntriesInBatchRequest Too many entries in a batch.

Sample requestSample request

Action=DeleteMessageBatch
&Version=2012-11-05
&QueueUrl=https://message-queue.api.cloud.yandex.net/b1g8ad42m6he********/dj6000000000********/sample-queue
&DeleteMessageBatchRequestEntry.1.Id=dd2dd32b-eb1e7a37-f6b7a725***-*****
&DeleteMessageBatchRequestEntry.1.ReceiptHandle=EAEg89f********
&DeleteMessageBatchRequestEntry.2.Id=7e0e07f6-5c9a0a72-d304102f***-*****
&DeleteMessageBatchRequestEntry.2.ReceiptHandle=EAEgq5v********

For more information about forming requests, see General API request format.

Response exampleResponse example

<DeleteMessageBatchResponse>
    <DeleteMessageBatchResult>
        <DeleteMessageBatchResultEntry>
            <Id>dd2dd32b-eb1e7a37-f6b7a725***-*****</Id>
        </DeleteMessageBatchResultEntry>
        <DeleteMessageBatchResultEntry>
            <Id>7e0e07f6-5c9a0a72-d304102f***-*****</Id>
        </DeleteMessageBatchResultEntry>
    </DeleteMessageBatchResult>
    <ResponseMetadata>
        <RequestId>e02ca0b-5e6b6d98-cef0a99c-150a53b3-07ee55365ba1b6fd876875f0********</RequestId>
    </ResponseMetadata>
</DeleteMessageBatchResponse>

Was the article helpful?

Previous
DeleteMessage
Next
ReceiveMessage
Yandex project
© 2025 Yandex.Cloud LLC