Amazon Simple Queue Service
API Reference (API Version 2012-11-05)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...



Deletes multiple messages. This is a batch version of DeleteMessage. The result of the delete action on each message is reported individually in the response.


Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.


Some API actions take lists of parameters. These lists are specified using the param.n notation. Values of n are integers starting from 1. For example, a parameter list with two elements looks like this:



Request Parameters

For information about the common parameters that all actions use, see Common Parameters.


A list of receipt handles for the messages to be deleted.

Type: DeleteMessageBatchRequestEntry list

Required: Yes


The URL of the Amazon SQS queue to take action on.

Type: String

Required: Yes

Response Elements

The following elements are returned in a structure named DeleteMessageBatchResult.


A list of BatchResultErrorEntry items.

Type: BatchResultErrorEntry list


A list of DeleteMessageBatchResultEntry items.

Type: DeleteMessageBatchResultEntry list


For information about the errors that are common to all actions, see Common Errors.


Two or more batch entries have the same Id in the request.

HTTP Status Code: 400


Batch request does not contain an entry.

HTTP Status Code: 400


The Id of a batch entry in a batch request does not abide by the specification.

HTTP Status Code: 400


Batch request contains more number of entries than permissible.

HTTP Status Code: 400


The following example DeleteMessageBatch request deletes two messages. You must URL encode the entire URL; however, we've URL encoded only the message body to make the example easier for you to read.

Sample Request



Sample Response