# API: Live

| Method | Path | What it does | Scope |
|---|---|---|---|
| PUT | `/v1/recordings/:id/live` | Your bot's live options: live transcript and prompts (before it joins), the AI participant in chat, mute it | `transcripts:write` |
| GET | `/v1/recordings/:id/live/items` | The live panel so far (the seller only): transcript lines, commitments, prompts and the AI participant's answers | `transcripts:read` |
| POST | `/v1/recordings/:id/live/items/:item/:decision` | Send (as your message) or discard a drafted AI assistant answer (in the app) (web app only) | `messages:send` |
| POST | `/v1/roleplay` | Start a practice conversation against a buyer persona built from your org's real buyers and objections (or one deal's) | `transcripts:write` |
| GET | `/v1/roleplay/:id` | A practice session (yours, or a report's for their managers) | `transcripts:read` |
| POST | `/v1/roleplay/:id/end` | End the practice and get your score (the coaching rubrics) | `transcripts:write` |
| POST | `/v1/roleplay/:id/messages` | Say something in your practice conversation; the buyer answers | `transcripts:write` |
| GET | `/v1/roleplay/reps/:id` | A rep's practice sessions and progress (the rep and their managers) | `transcripts:read` |

## Examples

### PUT /v1/recordings/$ID/live

Your bot's live options: live transcript and prompts (before it joins), the AI participant in chat, mute it

```bash
curl -s -X PUT "https://api.closefinch.com/v1/recordings/$ID/live" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.closefinch.com/v1/recordings/${id}/live`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/recordings/$ID/live/items

The live panel so far (the seller only): transcript lines, commitments, prompts and the AI participant's answers

```bash
curl -s "https://api.closefinch.com/v1/recordings/$ID/live/items" \
  -H "Authorization: Bearer $RA_API_KEY"
```

```js
const res = await fetch(`https://api.closefinch.com/v1/recordings/${id}/live/items`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/roleplay

Start a practice conversation against a buyer persona built from your org's real buyers and objections (or one deal's)

```bash
curl -s -X POST "https://api.closefinch.com/v1/roleplay" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.closefinch.com/v1/roleplay`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/roleplay/$ID

A practice session (yours, or a report's for their managers)

```bash
curl -s "https://api.closefinch.com/v1/roleplay/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
```

```js
const res = await fetch(`https://api.closefinch.com/v1/roleplay/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/roleplay/$ID/end

End the practice and get your score (the coaching rubrics)

```bash
curl -s -X POST "https://api.closefinch.com/v1/roleplay/$ID/end" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.closefinch.com/v1/roleplay/${id}/end`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/roleplay/$ID/messages

Say something in your practice conversation; the buyer answers

```bash
curl -s -X POST "https://api.closefinch.com/v1/roleplay/$ID/messages" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.closefinch.com/v1/roleplay/${id}/messages`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/roleplay/reps/$ID

A rep's practice sessions and progress (the rep and their managers)

```bash
curl -s "https://api.closefinch.com/v1/roleplay/reps/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
```

```js
const res = await fetch(`https://api.closefinch.com/v1/roleplay/reps/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();
```

Request and response schemas: [https://www.closefinch.com/openapi.json](https://www.closefinch.com/openapi.json). All resources: [API reference](https://www.closefinch.com/docs/api).
