Amazon Web ServicesAmazon SQS message-queue API
CreateQueue
<p>Creates a new standard or FIFO queue. You can pass one or more attributes in the request. Keep the following in mind:</p> <ul> <li> <p>If you don't specify the <code>FifoQueue</code> attribute, Amazon SQS creates a standard queue.</p> <note> <p>You can't change the queue type after you create it and you can't convert an existing standard queue into a FIFO queue. You must either create a new FIFO queue for your application or delete your existing standard queue and recreate it as a FIFO queue. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving">Moving From a standard queue to a FIFO queue</a> in the <i>Amazon SQS Developer Guide</i>. </p> </note> </li> <li> <p>If you don't provide a value for an attribute, the queue is created with the default value for the attribute.</p> </li> <li> <p>If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.</p> </li> </ul> <p>To successfully create a new queue, you must provide a queue name that adheres to the <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html">limits related to queues</a> and is unique within the scope of your queues.</p> <note> <p>After you create a queue, you must wait at least one second after the queue is created to be able to use the queue.</p> </note> <p>To retrieve the URL of a queue, use the <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueUrl.html"> <code>GetQueueUrl</code> </a> action. This action only requires the <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html#API_CreateQueue_RequestSyntax"> <code>QueueName</code> </a> parameter.</p> <p>When creating queues, keep the following points in mind:</p> <ul> <li> <p>If you specify the name of an existing queue and provide the exact same names and values for all its attributes, the <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html"> <code>CreateQueue</code> </a> action will return the URL of the existing queue instead of creating a new one.</p> </li> <li> <p>If you attempt to create a queue with a name that already exists but with different attribute names or values, the <code>CreateQueue</code> action will return an error. This ensures that existing queues are not inadvertently altered.</p> </li> </ul> <note> <p>Cross-account permissions don't apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant cross-account permissions to a role and a username</a> in the <i>Amazon SQS Developer Guide</i>.</p> </note>
The complete 23-action Amazon Simple Queue Service API, preserving AWS JSON 1.0, AWS Query compatibility, SigV4, and regional endpoint rules. Hub provides documentation and a local SDK/CLI; it does not proxy queue calls.
Request
- operationId
CreateQueue- Server
https://sqs.{Region}.{PartitionResult#dnsSuffix}- Authentication
- awsSigV4
Request parameters
No URL, query, or header parameters.
Request body
stringrequired
Responses
200
string
Successful response.
error
string
Declared service error