Skip to main content
Call Actors

Send Queue Message

Enqueue a durable message for an actor. Optionally wait for the actor to complete it and return a response.

By default, the request returns after the message is enqueued. Set wait to true to wait for message.complete(...); timeout sets that wait in milliseconds, and a timeout returns status: "timedOut" without canceling the queued work.

POST https://api.rivet.dev/gateway/{actor}/queue/{name}

Examples

Authentication

Send a token in the x-rivet-token header, inline in the path as {actor_id}@{token}, or in the rvt-token query parameter. Use a public token (pk_) from browsers and a secret token (sk_) from trusted backends. See Authentication.

Path Parameters

NameTypeRequiredDescription
actorstringYesActor ID, actor ID with an inline token ({actor_id}@{token}), or actor name combined with the rvt-* query parameters.
namestringYesName of the queue message as defined in the actor’s queues map.

Actor Selector

{actor} accepts an actor ID, an actor ID with an inline routing token ({actor_id}@{token}), or an actor name combined with the rvt-* query parameters below. See Actor Routing for the full rules.

Request Body

Content type: application/json.

FieldTypeRequiredDescription
bodyanyYesMessage payload. Any JSON value.
waitbooleanNoWait for the actor to complete the message and return its response.
timeoutintegerNoHow long to wait for completion, in milliseconds. Only used with wait.

Responses

200

The message was enqueued, with its completion status when waiting.

FieldTypeDescription
status"completed" | "timedOut"Whether the actor completed the message before the timeout.
responseanyValue the actor passed to complete(). Present when status is completed.
{
  "status": "completed",
  "response": {
    "count": 1
  }
}