Azure Queue Storage REST API Reference

This document provides a comprehensive reference for the Azure Queue Storage REST API. Queue Storage is a service that allows you to store large numbers of messages that can be accessed and processed by multiple applications.

Overview

The Azure Queue Storage REST API allows you to interact with Queue Storage programmatically. You can perform operations such as creating and deleting queues, adding and retrieving messages, and managing queue metadata.

Authentication

All requests to the Queue Storage REST API must be authenticated. Azure Queue Storage supports the following authentication methods:

  • Shared Key authorization
  • Shared Access Signature (SAS) authorization
  • Azure Active Directory (now Microsoft Entra ID) integration

For detailed information on authentication, refer to the Authentication for Azure Storage documentation.

REST Operations

The following table lists the primary REST operations available for Azure Queue Storage.

PUT Create Queue

/{{account-name}}/{{queue-name}}

Creates a new queue under the specified account.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.

Request Body

No request body is required for this operation.

Responses

Status Code Description
201 Created The queue was successfully created.
204 No Content The queue already exists.

DELETE Delete Queue

/{{account-name}}/{{queue-name}}

Deletes a specified queue and all the messages it contains.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.

Request Body

No request body is required for this operation.

Responses

Status Code Description
204 No Content The queue was successfully deleted.

GET List Queues

/{{account-name}}

Lists all queues associated with the storage account.

Query Parameters

Name Description
prefix An optional string value. The response includes the names of queues whose names begin with the specified prefix.
maxresults An integer value that limits the number of results to return.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.

Responses

Status Code Description
200 OK Successfully retrieved the list of queues.

POST Put Message

/{{account-name}}/{{queue-name}}/messages

Adds a new message to the back of a queue.

Query Parameters

Name Description
messagetimeout Optional. Specifies the time-to-live in seconds for the message. The maximum value is 7 days.
visibilitytimeout Optional. Specifies the visibility timeout in seconds.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.
Content-Length Required. The size of the message content in bytes.

Request Body

The message content to add to the queue.

<QueueMessage>
  <message>Your message content here</message>
</QueueMessage>

Responses

Status Code Description
201 Created The message was successfully added to the queue.

GET Peek Messages

/{{account-name}}/{{queue-name}}/messages

Retrieves one or more messages from the front of the queue without making them invisible.

Query Parameters

Name Description
numofmessages Optional. Specifies the number of messages to retrieve. Maximum is 32.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.

Responses

Status Code Description
200 OK Successfully retrieved messages.

GET Get Messages

/{{account-name}}/{{queue-name}}/messages

Retrieves one or more messages from the front of the queue and makes them invisible for a specified duration.

Query Parameters

Name Description
numofmessages Optional. Specifies the number of messages to retrieve. Maximum is 32.
visibilitytimeout Required for invisibility. Specifies the visibility timeout in seconds.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.

Responses

Status Code Description
200 OK Successfully retrieved messages.

DELETE Delete Message

/{{account-name}}/{{queue-name}}/messages/{{message-id}}

Deletes a specific message from the queue.

Query Parameters

Name Description
popreceipt Required. The pop receipt value returned from a previous Get Messages operation.

Request Headers

Name Description
x-ms-version Specifies the version of the REST API to use.
Authorization Required. Specifies the authorization details.

Responses

Status Code Description
204 No Content The message was successfully deleted.

Further Reading