Yandex Message Queue API

Yandex Message Queue provides an HTTP API that is partially compatible with the Amazon SQS API.

Making API requests

To make a request to the Yandex Message Queue API, send an HTTP POST request to the path / at

Content-Length: length
Content-Type: application/x-www-form-urlencoded
Authorization: authorization string (AWS Signature Version 4)

Request parameters

Request headers

All requests must have standard headers:

  • Content-Type: application/x-www-form-urlencoded.
  • Authorization: Request signature as per Authenticating Requests in the Amazon SQS documentation. If you use the SDK or a console client, a request and its signature are generated automatically and you only need to pass the request parameters.

Request parameters

All requests must contain standard parameters:

  • Action: the name of the API method being called.
  • Version: always equal to 2012-11-05.

Parameters are passed in the request body in the form-urlencoded format.

Passing arrays of parameters

Some message parameters, such as message or queue attributes, are passed as arrays. Each element of an array is passed as two or more request parameters. For example, for attributes, this is the name and value of an array element.

Example of using an attribute with multiple parameters:


In this example, attribute 1 is the VisibilityTimeout set to 40; attribute 2 is the MessageRetentionPeriod set to 1000.

API response

In response to an API request, Message Queue returns an XML structure containing the request result.

Successful response

If the request execution is successful, the main element of the response gets the name of the method being called plus the Response suffix (<Action> + "Response").

This element contains the following child elements:

Tag Description
ActionNameResult Contains elements specific to the method being called. For possible elements, see the documentation for each method. For example, CreateQueueResult contains the QueueUrl element with the URL of the queue created.
ResponseMetadata Contains the RequestId with the UUID of the request.

Example of a successful response:

<?xml version="1.0" encoding="UTF-8"?>

Error response

If a request fails, the main element of the response is named ErrorResponse. This element contains such child elements as Error and RequestId.

The Error element contains the following child elements:

Tag Description
Type Error type indicating whether the error occurred on the producer or consumer's side.
Code Error ID.

For a list of common errors, see Common errors.
Message Error description in English.
Detail Additional information about the error (optional).

The RequestId element contains the UUID of the request.

Example of an error response:

         Value (queuename_nonalpha) for parameter QueueName is invalid.
         Must be an alphanumeric String of 1 to 80 in length.