---
title: "Get a callback token from inside a workflow"
method: POST
path: "/durable-callbacks"
tags: ["Durable Functions"]
---

# Get a callback token from inside a workflow

`POST /durable-callbacks`

## Request

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

Registers a waiting step and returns its callback token. The Volcano
SDK calls this from `ctx.waitForCallback`; applications do not call it
directly.

`execution_ref` and `callback_id` are opaque values the SDK reads from
the running workflow. Together they are the request's credential, so
the operation takes no other authentication. The token works until
the step's own timeout, and only for that step.

Retrying is safe: a request for a step that is already registered
returns the same token with `200` while the step still waits. Once
the token is answered, or the step times out or ends, a retry answers
`409` with `callback_closed`.

## Request body

- RegisterDurableCallbackRequest
  - `execution_ref` string, required: Opaque reference to the running execution, supplied by the SDK.
  - `callback_id` string, required: Opaque reference to the waiting step, supplied by the SDK.
  - `name` string, required: The waiting step's name, up to 237 printable ASCII characters.
  - `operation_id` string: The operation an earlier run of the workflow opened the waiting step under, supplied by the SDK when a replay registers it. Volcano then looks for the step further back in the execution's history than a first registration reads.

## Response `200`

The step was already registered; its token is returned

- DurableCallbackRegistration: The token for the waiting step, as the workflow receives it.
  - `token` string, required: The `vcb_` token the workflow handed out. It is the only credential the callback operations take, so treat it as a secret.
  - `expires_at` string, date-time, nullable, required: When the waiting step's `timeout` passes and the token stops working. Null when the workflow set no `timeout`. A step with a heartbeat timeout also ends once that long passes without a heartbeat, which can be before this time.

## Other responses

- `201`: Token issued
- `400`: The request body is invalid
- `404`: No running durable execution matches `execution_ref`
- `409`: The token cannot be issued now. `code` says why: - `callback_not_ready`: the workflow has not finished opening the step yet. Retry with a short backoff; the SDK does. - `callback_closed`: the workflow is no longer waiting on it. - `callback_taken`: the step is already registered as an approval or a message wait. - `execution_ended`: the execution has finished. - `too_many_callback_tokens`: the execution already holds the maximum number of open tokens.
- `413`: The request body is larger than 8 KiB
- `429`: Too many requests from this execution
- `503`: The step could not be confirmed with the workflow right now. Retry with backoff.

## Changes

- **2026-10-23** `5113707385cc`: 1 info
  - endpoint added

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