| Did this page help you? Yes No Tell us about it... |
The CreateQueue action creates a new queue.
When you request CreateQueue, you provide a name for the queue. To
successfully create a new queue, you must provide a name that is unique
within the scope of your own queues.
![]() | Note |
|---|---|
If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name. |
If you provide the name of an existing queue, along with the exact names and values of all the queue's attributes,
CreateQueue returns the queue URL for the existing queue. If the queue name, attribute names,
or attribute values do not match an existing queue, CreateQueue returns an error.
![]() | Tip |
|---|---|
Use GetQueueUrl to get a queue's URL.
|
The default value for the queue's attributes are set when the queue is
created. You can override these values with the Attribute.n.name and Attribute.n.value
request parameters. For the default values of each attribute, see the table of parameters in Request Parameters.
![]() | Note |
|---|---|
Some API operations take lists of parameters. These lists are specified using the &Attribute.1=this &Attribute.2=that |
The following table lists the special request parameters the CreateQueue
action uses in addition to the common parameters all actions use (for more information, see Common Query Parameters).
| Name | Description | Required |
|---|---|---|
|
|
The name to use for the queue created. Type: String Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed. |
Yes |
|
|
The name of the attribute you want to set.
|
No |
|
|
The value of the attribute you want to set. Constraints: Constraints are specific for each value.
Default: Varies according to attribute |
Yes, if there is a corresponding Name Attribute.n.name parameter |
The following table lists the elements that the CreateQueue response includes in
addition to the elements that are returned in all successful responses (for more information, see Responses
section in the Amazon SQS Developer Guide.
| Name | Description |
|---|---|
|
|
The queue URL for the queue that you created. Type: String Ancestor: |
The following table lists the special errors that the CreateQueue action returns
in addition to the common errors that all actions return (for more information, see Common Errors).
| Error | Description | HTTP Status Code |
|---|---|---|
|
|
You must wait 60 seconds after deleting a queue before you can create another with the same name. |
400 |
|
|
Queue already exists. SQS returns this error only if the request includes an attribute name or value that differs from the name or value for the existing attribute. |
400 |
The following example Query request creates a new queue named queue2.
http://sqs.us-east-1.amazonaws.com/ ?Action=CreateQueue &QueueName=testQueue &Attribute.1.Name=VisibilityTimeout &Attribute.1.Value=40 &Version=2011-10-01 &SignatureMethod=HmacSHA256 &Expires=2011-10-18T22%3A52%3A43PST &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &SignatureVersion=2 &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE
<CreateQueueResponse>
<CreateQueueResult>
<QueueUrl>
http://sqs.us-east-1.amazonaws.com/123456789012/testQueue
</QueueUrl>
</CreateQueueResult>
<ResponseMetadata>
<RequestId>
7a62c49f-347e-4fc4-9331-6e8e7a96aa73
</RequestId>
</ResponseMetadata>
</CreateQueueResponse>