---
title: "Send a message to a durable execution from an application"
method: POST
path: "/durable-functions/{functionId}/executions/{executionId}/messages"
tags: ["Durable Functions"]
---

# Send a message to a durable execution from an application

`POST /durable-functions/{functionId}/executions/{executionId}/messages`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/durable-functions/{functionId}/executions/{executionId}/messages`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Sends a named message to a running execution. The workflow receives it
from `ctx.waitForMessage` with the same name. A message sent before
anything waits for its name is kept, and each wait takes the oldest
one, so messages arrive in the order they were sent.

Messages never decide an approval: a workflow waiting in
`ctx.waitForApproval` is not resumed by one.

**With a service key:** any execution in the project.

**With an auth user token:** an execution the user started, or one
whose `X-Volcano-Client-Token` the request carries, of a durable
function whose `visibility` is `authenticated` or `public`.

**With an anon key:** an execution whose `X-Volcano-Client-Token` the
request carries, of a function with `visibility: public`.

Any other execution answers `404`, as a missing one does.

Send `Idempotency-Key` to make a retry safe: a repeat with a key the
same sender has used on the execution returns the first message with
`200` and sends nothing.

## Path parameters

- `functionId` string, required
- `executionId` string, uuid, required

## Headers

- `Idempotency-Key` string
- `X-Volcano-Client-Token` string

## Request body

- SendDurableMessageRequest
  - `name` string, required: The name a workflow waits on or publishes under: up to 237 printable ASCII characters.
  - `data` unknown

## Response `200`

A message with this `Idempotency-Key` was already sent; it is returned

- DurableMessage: A message sent to, or published by, a durable execution.
  - `id` string, uuid, required
  - `execution_id` string, uuid, required
  - `direction` 'in' | 'out', required: `in` is a message sent to the execution. `out` is one the execution published.
  - `seq` integer, required: Orders the execution's messages in both directions. It increases with every message but can skip numbers. Pass the last one you read as `after` to read what came next.
  - `name` string, required
  - `data` unknown, required
  - `sender` DurableMessageSender, required: Who sent the message.
    - `type` 'service_key' | 'user' | 'anon' | 'project' | 'execution', required: The credential the message was sent with. `project` is the project's owner or one of its access tokens, and `execution` is the execution itself publishing.
    - `user_id` string, nullable, required: The auth user who sent it. Null unless `type` is `user`.
  - `status` 'queued' | 'delivering' | 'delivered' | 'dropped' | 'published', required: An `in` message is `queued` until a wait for its name takes it, `delivering` while it is handed over, and `delivered` once the execution has it. It is `dropped` if the execution ended before any wait took it. Every `out` message is `published`.
  - `delivered_at` string, date-time, nullable, required: When the execution received the message. Null until then, and for `out` messages.
  - `sent_at` string, date-time, required

## Other responses

- `201`: Message sent. `status` is `delivered` when a wait took it at once, `delivering` when a wait took it and the handover is still being confirmed, and `queued` when it is kept for the next wait.
- `400`: The name, data or idempotency key is invalid
- `401`: Missing or invalid credential
- `403`: The anon key lacks `functions.invoke`, the service key is scoped without it, or the function is `authenticated` and the request carries an anon key. Also returned when the request's origin is refused by the project's CORS policy.
- `404`: Durable function or execution not found, or the credential cannot reach the execution. A `private` function answers every credential but a service key this way.
- `409`: The message cannot be sent. `code` says why: - `execution_not_running`: the execution has finished. - `too_many_queued_messages`: the execution already holds the maximum number of messages nothing has taken.
- `413`: The request body is larger than 72 KiB
- `429`: Too many messages sent to this execution, the function's or the project's function rate limit, which sends share with invocations and starts, or the project is over its bandwidth cap.
- `503`: The plan terms for the request could not be read. Retry with backoff.

## Changes

- **2026-10-23** `5113707385cc`: 1 breaking
  - added the pattern `^[ -~]+$` to the `header` request parameter `Idempotency-Key`
- **2026-10-16** `7fec2090c1f4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/durable-functions/:functionId/executions/:executionId/messages/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
