queue.messages.receive

Receive up to 10 messages, hiding them for the visibility timeout

POST /queue/api/queues/{name}/receiveIAM queue:ReceiveMessageChanges state

waitSeconds (0–20) long-polls until a message arrives. Each message carries a receiptHandle: delete it with messages delete once processed, or it becomes visible again when the timeout ends. Changes state: received messages are hidden from other consumers.

Request syntax

POST /queue/api/queues/{name}/receive
{
  "maxMessages": "number",
  "visibilityTimeoutSeconds": "number",
  "waitSeconds": "number"
}

Path parameters

  • nameRequired

    string

    Constraints: max 80 chars, /^[A-Za-z0-9_-]+(\.fifo)?$/

Request body

  • maxMessagesOptional

    number

    Most messages to return (default 1)

    Constraints: integer, 1-10

  • visibilityTimeoutSecondsOptional

    number

    Seconds the received messages stay hidden from other consumers (default: the queue’s visibility timeout)

    Constraints: integer, 0-43200

  • waitSecondsOptional

    number

    Seconds to wait for a message when none is available; 0 answers at once (default: the queue’s receive wait)

    Constraints: integer, 0-20

Response

200; data.messages lists the received messages (empty when none arrived in time), each with messageId, receiptHandle, body, md5OfBody, attributes, attributeTypes, sentAt, receiveCount, firstReceivedAt, deadLetterSourceQueueId and, on FIFO queues, messageGroupId, messageDeduplicationId and sequenceNumber.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow queue:ReceiveMessage on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud queue messages receive name

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_queue_messages_receive.