---
title: "Open a messages session from inside a workflow"
method: POST
path: "/durable-messages/sessions"
tags: ["Durable Functions"]
---

# Open a messages session from inside a workflow

`POST /durable-messages/sessions`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/durable-messages/sessions`
- Auth: none required

Opens the session a workflow publishes messages with. The Volcano SDK
calls this once per workflow context, on its first `ctx.publish`;
applications do not call it directly.

As for a wait, `execution_ref` and `callback_id` are the credential.
The session's token is delivered to the workflow itself and never
appears in a response.

Retrying is safe: a request for a session that is already registered
returns it with `200`.

## Request body

- OpenDurableMessageSessionRequest
  - `execution_ref` string, required: Opaque reference to the running execution, supplied by the SDK.
  - `callback_id` string, required: Opaque session reference, supplied by the SDK.

## Response `200`

The session was already registered

- DurableMessageSessionRegistration: The registered session. Its token reaches the workflow through the workflow itself, never in this response.
  - `id` string, uuid, required

## Other responses

- `201`: Session opened
- `400`: The request body is invalid
- `404`: No running durable execution matches `execution_ref`
- `409`: The session cannot be opened now. `code` is `callback_not_ready`, `callback_closed`, `callback_taken` (the callback is already registered as an approval or a message wait), `execution_ended`, or `too_many_message_sessions`.
- `413`: The request body is larger than 8 KiB
- `429`: Too many requests from this execution
- `503`: The session could not be confirmed with the workflow right now. Retry with backoff.

## Changes

- **2026-10-16** `7fec2090c1f4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/durable-messages/sessions/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)
