# API: Sales floor

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/floor/feed` | Wins: meetings booked on calls, deals moved forward or won (a room's members, or everyone's) | `calls:read` |
| GET | `/v1/floor/leaderboard` | Today, this week or this month (your time zone): dials, connects, connect rate, talk time, conversations of 2 minutes or more, meetings booked, pipeline created. From call activities, dispositions, meetings and deals. A room's board to its members; otherwise you and the people who report to you (owners: everyone) | `calls:read` |
| POST | `/v1/floor/listens` | Listen to a rep's live call (a manager above them, or an owner when an owner allows it): the monitoring notice plays to the other party first, then your own confirmed phone rings as a silent listener nobody hears (web app only) | `calls:write` |
| GET | `/v1/floor/listens/:id` | Your listen: its state, the live transcript (when the call guide is on and nobody objected) and your notes (web app only) | `transcripts:read` |
| POST | `/v1/floor/listens/:id/end` | Stop listening (web app only) | `calls:write` |
| POST | `/v1/floor/listens/:id/mode` | Switch: monitor (nobody hears you), whisper (only the rep hears you) or barge (both ends hear you) (web app only) | `calls:write` |
| POST | `/v1/floor/listens/:id/notes` | A note to the rep during the call (shown on their dialer) (web app only) | `calls:write` |
| GET | `/v1/floor/my-listens` | For the rep: who is listening to your current call, and their notes to you | `calls:read` |
| GET | `/v1/floor/rooms` | Your sales-floor rooms (owners: every room) | `calls:read` |
| POST | `/v1/floor/rooms` | Make a room: a team room (owners) or an ad-hoc one (anyone; you're in it) | `calls:write` |
| DELETE | `/v1/floor/rooms/:id` | Close a room | `calls:write` |
| GET | `/v1/floor/rooms/:id` | A room: each member's live state from the dialer and the desktop (idle, dialing, on a call and with whom, wrap-up), presence, and whether you may listen in | `calls:read` |
| PUT | `/v1/floor/rooms/:id` | Change a room (the person who made it, or an owner; team rooms: owners) | `calls:write` |
| POST | `/v1/floor/rooms/:id/join` | Join an ad-hoc room yourself (its members then see your live state) (web app only) | `calls:write` |
| POST | `/v1/floor/rooms/:id/leave` | Leave a room (web app only) | `calls:write` |

## Examples

### GET /v1/floor/feed

Wins: meetings booked on calls, deals moved forward or won (a room's members, or everyone's)

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

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

### GET /v1/floor/leaderboard

Today, this week or this month (your time zone): dials, connects, connect rate, talk time, conversations of 2 minutes or more, meetings booked, pipeline created. From call activities, dispositions, meetings and deals. A room's board to its members; otherwise you and the people who report to you (owners: everyone)

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

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

### GET /v1/floor/my-listens

For the rep: who is listening to your current call, and their notes to you

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

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

### GET /v1/floor/rooms

Your sales-floor rooms (owners: every room)

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

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

### POST /v1/floor/rooms

Make a room: a team room (owners) or an ad-hoc one (anyone; you're in it)

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

```js
const res = await fetch(`https://api.closefinch.com/v1/floor/rooms`, {
  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();
```

### DELETE /v1/floor/rooms/$ID

Close a room

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

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

### GET /v1/floor/rooms/$ID

A room: each member's live state from the dialer and the desktop (idle, dialing, on a call and with whom, wrap-up), presence, and whether you may listen in

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

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

### PUT /v1/floor/rooms/$ID

Change a room (the person who made it, or an owner; team rooms: owners)

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

```js
const res = await fetch(`https://api.closefinch.com/v1/floor/rooms/${id}`, {
  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();
```

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).
