# Meetings

A **meeting** is a customer meeting or site walk that someone recorded in TruTec, uploaded, or pasted the notes of. TruTec writes it up: a summary, what was decided, what the customer asked for, the sizes and counts that were said, a draft estimate outline matched to the catalog, and the to-dos that came up. In the app it lives under **Meetings**.

The API **reads meetings and adds one from notes**. Acting on a meeting stays with a person in the app: creating its to-dos, saving the notes on the job or customer timeline, starting the estimate and emailing the customer a recap are each a click on the meeting page, never an API call. Recordings are private and are never returned. A workspace needs TruTec Bid or Build to have Meetings; other workspaces get `403`.

## List meetings

`GET /v1/meetings` returns the workspace's meetings, newest first, a page at a time (`limit`, `offset`).

| Filter | What it does |
|---|---|
| `q` | Words in the meeting name, the customer or job name, the notes, or what was said |
| `status` | `ready` once the notes are written; `recording`, `uploaded`, `transcribing`, `reading` on the way; `failed` |
| `client_account_id`, `location_id`, `job_id` | One customer, one site, or one job |
| `updated_after` | Changed after this time (ISO 8601), for syncing |

```bash
curl "https://trutec.ai/api/v1/meetings?q=drainage&client_account_id=9031" \
  -H "X-API-Key: $TRUTEC_API_KEY"
```

Each meeting carries `next_step`, what it is still waiting on in words ("Save the notes", "Create 3 to-dos", "All followed up").

## Get one meeting

`GET /v1/meetings/{meeting_id}` adds `attendees`, `decisions`, `customer_asked_for`, `measurements`, the `estimate_outline` (each line with the catalog service it matched, when one did) and `to_dos`. A to-do is `proposed` until a person creates it in the app, then `open`, `overdue` or `done`. Send `include_transcript=1` for the words that were said.

## Add a meeting from notes

`POST /v1/meetings` takes `notes` (the notes or transcript, at least 20 characters) and optionally `title`, `client_account_id`, `location_id`, `job_id`, `lead_id` and `met_on`. A job brings its own customer and site. The answer comes back right away with `status: reading`; the write-up is ready within about a minute, so read the meeting again or list with `status=ready`.

```bash
curl -X POST "https://trutec.ai/api/v1/meetings" \
  -H "X-API-Key: $TRUTEC_API_KEY" -H "Content-Type: application/json" \
  -d '{"job_id": 80112, "notes": "Dana: sealcoat and restripe the east lot this year, at night. You: proposal by Friday."}'
```

## Upcoming meetings from a calendar

`GET /v1/meetings/upcoming` lists the customer meetings on the calendar of **the person who made the API key**, from now through the next week: the time, the outside people invited, the customer, site, job or lead TruTec matched it to (`matched_by` is `auto` or `person`), `video_call` (`zoom`, `meet`, `teams`) when it has a link, and where the notetaker stands. A calendar belongs to one person, so a key made by someone else gets 403. Until that person connects their calendar in Meetings (Upcoming), `data` is empty and `calendar_connected` is false. Meetings with only teammates and personal events are never read.

```bash
curl "https://trutec.ai/api/v1/meetings/upcoming" -H "X-API-Key: $TRUTEC_API_KEY"
```

## Send or cancel the notetaker

`POST /v1/meetings/upcoming/{event_id}/notetaker` asks TruTec's notetaker to join that meeting's Zoom, Google Meet or Microsoft Teams call. It joins as a guest named "<Company> notetaker (TruTec)" two minutes before the start (right away if the call is under way), posts a recording notice in the call's chat, and the meeting is written up like any other. Someone in the call has to let it in. `POST /v1/meetings/upcoming/{event_id}/notetaker/cancel` takes it off; one already in the call leaves within seconds and what it recorded is kept.

Both answer 409 until a workspace owner has turned the notetaker on (Meetings, Upcoming, Calendar settings). Recording a call needs the consent of the people on it in many places; the owner acknowledges that when turning it on.
