ChangeMessageVisibility

Changes the visibility timeout for a message to the value you provide in the VisibilityTimeout parameter. This action can be used in one of several ways described in Visibility Timeout.

[Important]Important

Unlike with a queue, when you change the visibility timeout for a specific message, that timeout value is applied immediately but is not saved in memory for that message. If after receiving a message, if for some reason you don't delete the message and the message is received again, the visibility timeout for the message when it is received again is the overall value for the queue and not the value you previously set with the ChangeMessageVisibility action. Similarly for messages that you've locked, when the lock expires and the message is received, the visibility timeout used for the message is the overall value for the queue and not the value you previously set.

The following table lists the special request parameters the action uses (in addition to the common request parameters listed in Common Request Parameters).

NameDescriptionRequired

MessageId

The message ID of the message whose visibility timeout you want to change.

Type: String

Yes

VisibilityTimeout

The new value for the message's visibility timeout (in seconds).

Type: Integer from 0 to 86400 (maximum 24 hours).

Yes

The response contains no special elements besides the common elements listed in The Structure of a Response.

The action returns no errors besides the common errors listed in Common Errors.

The following example Query request changes the visibility timeout for a message to 60 seconds.