queue.messages.send

Send one message

POST /queue/api/queues/{name}/messagesIAM queue:SendMessageChanges state

body is text (no control characters besides tab, LF, CR); attributes are up to 10 string pairs. delaySeconds (0–900) keeps it invisible that long (standard queues only). On a FIFO queue messageGroupId is required, and messageDeduplicationId too unless the queue has contentBasedDeduplication; a repeat within five minutes answers the original messageId with duplicate: true. Answers 201 with messageId, md5OfBody and, on FIFO, sequenceNumber.

Request syntax

POST /queue/api/queues/{name}/messages
{
  "body": "string",
  "delaySeconds": "number",
  "attributes": "map of string",
  "messageGroupId": "string",
  "messageDeduplicationId": "string"
}

Path parameters

  • nameRequired

    string

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

Request body

  • bodyRequired

    string

    The message content, as text

    Constraints: min 1 chars

  • delaySecondsOptional

    number

    Seconds the message stays invisible before it can be received; standard queues only (default: the queue’s delay)

    Constraints: integer, 0-900

  • attributesOptional

    map of string

    Name–value string pairs delivered with the message (default none)

    Constraints: key=value

  • messageGroupIdOptional

    string

    FIFO queues: required; messages of one group are delivered in order, one batch at a time. Ignored on a standard queue

    Constraints: /^[A-Za-z0-9!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]{1,128}$/

  • messageDeduplicationIdOptional

    string

    FIFO queues only: a send repeating this id within five minutes is accepted but not stored again. Required unless the queue has content-based deduplication

    Constraints: /^[A-Za-z0-9!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]{1,128}$/

Response

201; data holds messageId, md5OfBody (MD5 of the body, hex), sentAt, sequenceNumber (FIFO, 20 digits; null on a standard queue) and duplicate (true when a FIFO send repeated a recent deduplication id and nothing new was stored).

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:SendMessage 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 send name --body example

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