GetQueueUrl - Amazon Simple Queue Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Returns the URL of an existing Amazon SQS queue.

To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId parameter to specify the account ID of the queue's owner. The queue's owner must grant you permission to access the queue. For more information about shared queue access, see AddPermission or see Allow Developers to Write Messages to a Shared Queue in the Amazon SQS Developer Guide.

Request Parameters

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


The name of the queue whose URL must be fetched. Maximum 80 characters. Valid values: alphanumeric characters, hyphens (-), and underscores (_).

Queue URLs and names are case-sensitive.

Type: String

Required: Yes


The Amazon Web Services account ID of the account that created the queue.

Type: String

Required: No

Response Elements

The following element is returned by the service.


The URL of the queue.

Type: String


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


The specified queue doesn't exist.

HTTP Status Code: 400



The following example query request gets the URL for the specified queue. The structure of AUTHPARAMS depends on the signature of the API request. For more information, see Examples of Signed Signature Version 4 Requests in the Amazon General Reference.

Sample Request ?Action=GetQueueUrl &QueueName=MyQueue &Expires=2020-10-24T22%3A52%3A43PST &Version=2012-11-05 &AUTHPARAMS

Sample Response

<GetQueueUrlResponse> <GetQueueUrlResult> <QueueUrl></QueueUrl> </GetQueueUrlResult> <ResponseMetadata> <RequestId>470a6f13-2ed9-4181-ad8a-2fdea142988e</RequestId> </ResponseMetadata> </GetQueueUrlResponse>

See Also

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