---
title: "Mint a live WebSocket ticket for a run"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mint a live WebSocket ticket for a run

Path: CloudRaker Workspace API › Playbooks

`POST /spaces/{spaceId}/playbook-runs/{runId}/ws-ticket`

Mints a short-lived ticket for opening the run's live WebSocket, used to stream timeline events in real time (the WS upgrade itself is not exposed over this API / MCP surface). Authorization: `space:read` (org admins bypass); missing → 404. No request body. The ticket carries a capability view — "full" when the caller has `space:contribute`, otherwise "sanitized" (artifact URLs redacted on the stream). Returns 200 `{ ticket, expiresAt }`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`mintPlaybookRunWsTicket.path.spaceId`; string, required)
- `runId` (`mintPlaybookRunWsTicket.path.runId`; string, required)

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/ws-ticket' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/ws-ticket';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/ws-ticket"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 200

A ticket and its expiry for the run WebSocket.

#### Example

```json
{
  "ticket": "string",
  "expiresAt": "2019-08-24T14:15:22Z"
}
```

- `ticket` (`mintPlaybookRunWsTicket.response.200.ticket`; string, required) — Single-use and short-lived.
- `expiresAt` (`mintPlaybookRunWsTicket.response.200.expiresAt`; string, required)
  - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`


Source: https://docs.cloudraker.com/workspace/api/playbooks/mint-playbook-run-ws-ticket/index.md
