Amazon Simple Queue Service
API Reference (API Version 2012-11-05)


Deletes up to ten messages from the specified queue. This is a batch version of DeleteMessage. The result of the 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 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 parameters that are common to all actions, see Common Parameters.


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

Type: Array of DeleteMessageBatchRequestEntry objects

Required: Yes


The URL of the Amazon SQS queue from which messages are deleted.

Queue URLs are case-sensitive.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.


A list of BatchResultErrorEntry items.

Type: Array of BatchResultErrorEntry objects


A list of DeleteMessageBatchResultEntry items.

Type: Array of DeleteMessageBatchResultEntry objects


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


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

HTTP Status Code: 400


The batch request doesn't contain any entries.

HTTP Status Code: 400


The Id of a batch entry in a batch request doesn't abide by the specification.

HTTP Status Code: 400


The batch request contains more entries than permissible.

HTTP Status Code: 400


In the following example, a DeleteMessageBatch request deletes two messages. You must URL-encode the entire URL. However, in this example only the message body is URL-encoded to make the example easier to read. How you structure the AUTHPARAMS depends on how you are signing your API request. For information about AUTHPARAMS in Signature Version 4, see Examples of Signed Signature Version 4 Requests in the Amazon Web Services General Reference.

Sample Request

Sample Response


See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: