# Fireflies Collab API — Yogesh personal account

**Account:** `yogesh.kaurav@admedia.com`  
**Auth:** `FIREFLIES_API_KEY` from Yogesh’s Fireflies Integrations (Personal / Developer settings)  
**Scope:** Meetings visible to that API key only.

Base: `http://localhost:6010/internal/v1`  
Headers: `Authorization: Bearer $COLLAB_S2S_TOKEN`, `X-Lucos-Org-Id`, `Content-Type: application/json`

```bash
cd /Users/harshitkaurav/Desktop/Admedia/slack-bot-service.com
TOKEN=$(grep '^COLLAB_S2S_TOKEN=' .env | cut -d= -f2-)
ORG=00000000-0000-0000-0000-000000000001
```

## Env

```bash
FIREFLIES_API_KEY=<yogesh-api-key>
FIREFLIES_ACCOUNT_EMAIL=yogesh.kaurav@admedia.com
FIREFLIES_MAX_CHARS=100000
# Optional:
# FIREFLIES_MEETING_INDEX_PATH=./data/fireflies-meeting-index.json
# FIREFLIES_WEBHOOK_SECRET=
# FIREFLIES_FRED_INVITE_ENABLED=false
```

Get / rotate key: [Integrations → Fireflies API](https://app.fireflies.ai/integrations/custom/fireflies) while logged in as Yogesh, or **Settings → Personal → Developer settings**.

**Free plan note:** `audio_url` / `video_url` need Fireflies Pro+. Search, summary, transcript, Meet link still work.

## Tools

| Tool | Purpose |
|------|---------|
| `fireflies_search_meetings` | Search Yogesh’s meetings (optional filters) |
| `fireflies_get_meeting` | Summary / full transcript (sentence pagination) |
| `fireflies_list_users` | Confirm API key owner / seats |
| `fireflies_ingest_recent` | Poll + upsert local meeting index |
| `fireflies_list_indexed` | Read local index |
| `fireflies_find_duplicates` | Different `meeting_id`s, same title+day |
| `fireflies_correlate_meeting` | Fireflies + Calendar + Drive bundle |
| `fireflies_ensure_fred_invite` | Add `fred@fireflies.ai` to upcoming Meet events on a calendar |

Webhook: `POST /internal/v1/webhooks/fireflies` with `X-Fireflies-Secret: $FIREFLIES_WEBHOOK_SECRET`

## ChatGPT (yogesh mcp local) sample prompts

```
List Fireflies users
Search Fireflies meetings
Search Fireflies for Admedia Product Requirement Call
Get Fireflies summary for meeting_id MEETING_ID
Get full Fireflies transcript for meeting_id MEETING_ID
```

## Curls

### List users (expect Yogesh)

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_list_users \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{}}' | python3 -m json.tool
```

### Search

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_search_meetings \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{"limit":20}}' | python3 -m json.tool
```

### Search with keyword + dates

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_search_meetings \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{
    "keyword":"standup",
    "scope":"all",
    "from":"2026-08-01T00:00:00.000Z",
    "to":"2026-08-31T23:59:59.000Z",
    "limit":20
  }}' | python3 -m json.tool
```

### Get summary

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_get_meeting \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{"meeting_id":"MEETING_ID","mode":"summary"}}' | python3 -m json.tool
```

### Get full transcript (paginated)

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_get_meeting \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{
    "meeting_id":"MEETING_ID",
    "mode":"full",
    "sentence_offset":0,
    "sentence_limit":100
  }}' | python3 -m json.tool
```

### Ingest / index

```bash
npm run fireflies:ingest
```

### Correlate

Matches Calendar by: Fireflies `calendar_id` → **Meet code** → Meet URL → fuzzy title+time (±15m) → Drive by title.

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_correlate_meeting \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{"meeting_id":"MEETING_ID","user":"yogesh.kaurav@admedia.com"}}' | python3 -m json.tool
```

Response `calendar_match`: `calendar_id` | `meet_code` | `meeting_link` | `fuzzy_title_time`.

### Find duplicates

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_find_duplicates \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{"limit":50}}' | python3 -m json.tool
```

### Fred invite (dry-run)

```bash
curl -sS http://localhost:6010/internal/v1/tools/fireflies_ensure_fred_invite \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Lucos-Org-Id: $ORG" \
  -H 'Content-Type: application/json' \
  --data-binary '{"environment":"staging","args":{
    "user":"yogesh.kaurav@admedia.com",
    "look_ahead_days":7,
    "dry_run":true,
    "force":true
  }}' | python3 -m json.tool
```
