POST /v1/realtime/session
Mints a short-lived token for the workflow realtime Socket.IO endpoint. Connect with socket.io-client using `path: socketPath` and `auth: {token: sessionToken}`, then subscribe to topics (workflow-runs, run, activity, execution, contract). Returns 503 when the realtime transport is not enabled on the environment — fall back to the SSE stream endpoints.

Responses

200 sessionToken + socketPath + expiresInSeconds
application/json
403 Forbidden
503 Service Unavailable
curl -X POST 'https://api.example.com/v1/realtime/session' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://api.example.com/v1/realtime/session', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://api.example.com/v1/realtime/session', headers=headers)print(response.json())
package mainimport (	"fmt"	"io"	"net/http")func main() {	req, _ := http.NewRequest("POST", "https://api.example.com/v1/realtime/session", nil)	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")	resp, _ := http.DefaultClient.Do(req)	defer resp.Body.Close()	result, _ := io.ReadAll(resp.Body)	fmt.Println(string(result))}
200 Response
"<object>"