# Check Each Coach's Sessions Next Week for a Missing Join Link or a Declined Invite

A coaching platform gives each coach an agent that reads next week's Outlook calendar and lists sessions with no join link, a declined invite or a clash.

[Run this on Rush](https://cloud.getrush.ai/run/check-next-weeks-sessions-for-missing-links/microsoft-calendar/). Opens the console with this prompt ready to send. Connect Microsoft Calendar there first.

## What the agent does

This is for an online coaching platform: career and leadership coaches who sell packages of one-hour video sessions to clients. Most of its coaches run their week from an Outlook calendar on a Microsoft 365 work account, and the sessions that go wrong go wrong the same few ways: the invite went out without a Teams link, the client declined and nobody noticed, or a session was moved on top of another one. The platform wants each coach to get a short list every Friday of next week's sessions that need a fix. It saves one agent as a template whose `connections` name `microsoft-calendar`, and makes one agent from it per coach. The coach connects from the platform's settings: the backend calls `POST /o/{org}/agents/<agent id>/connections {"type": "app", "name": "microsoft-calendar"}` and opens the `authorize_url` in a popup, where the coach signs in on Microsoft's page.

The agent reads the calendar through Microsoft Graph, which Rush signs as that coach. It calls `GET /me/calendarView` with `startDateTime` and `endDateTime` for next Monday to Sunday, written with the coach's UTC offset, and sends `Prefer: outlook.timezone` with the coach's time zone so start and end times come back in local time rather than UTC. `calendarView` returns each occurrence of a recurring series as its own event, which matters for coaches who book a client every Tuesday. It asks with `$select` for `subject`, `start`, `end`, `categories`, `attendees`, `isOnlineMeeting`, `onlineMeeting`, `location`, `bodyPreview`, `isCancelled`, `showAs` and `webLink`, and follows `@odata.nextLink` until the week is complete.

A session is an event in the category the platform asks coaches to use, `Coaching`. For each one the agent checks four things. A join link: `isOnlineMeeting` true with an `onlineMeeting` join URL, or a meeting URL in `location` or `bodyPreview` for coaches who use Zoom; otherwise it is flagged. The client: each attendee's response, flagging `declined` and anyone who has not responded two days before the session. Cancelled sessions still on the calendar (`isCancelled`). And clashes: a session that overlaps another busy event in the same week.

The agent changes nothing. Rush's Microsoft Calendar sign-in has `Calendars.ReadWrite`, so the token could edit or cancel events, and the prompt forbids every write: no create, update, delete, accept, decline or cancel. The coach fixes the invite in Outlook, where the client sees the change come from them.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "<agent id>",
  "input": "Check this coach's sessions next week. Coach time zone: America/Chicago. Week: 2026-11-30T00:00:00-06:00 to 2026-12-07T00:00:00-06:00. Call GET /me/calendarView with those as startDateTime and endDateTime, header Prefer: outlook.timezone=\"America/Chicago\", $select=subject,start,end,categories,attendees,isOnlineMeeting,onlineMeeting,location,bodyPreview,isCancelled,showAs,webLink; follow @odata.nextLink. A session is an event with category Coaching. Flag: no_link (not isOnlineMeeting with an onlineMeeting join URL, and no https meeting URL in location or bodyPreview); declined (any attendee declined); no_response (an attendee has not responded and the session starts within 2 days of 2026-11-27); cancelled_still_listed (isCancelled); clash (overlaps another event whose showAs is busy or oof). Return JSON: sessions_checked, needs_fix: [{subject, start, client, problems, webLink}] by start time. Read only: never create, update, delete, accept, decline or cancel an event."
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

The agent lists next week's sessions that need a fix, in time order, each with the client, the problem and a link that opens the event in Outlook. Each run answers with a JSON object: how many sessions it checked, and for each one that needs a fix the problems it found and the event's `webLink`, so the coach opens it in one click. A week with nothing to fix comes back with an empty `needs_fix`, which the platform shows as a green check rather than an email.

The coach decides what each flag means. A client who has not responded may still turn up, and a clash with a dentist appointment may be one the coach plans to move. The platform's team checks the first weeks against a few coaches' calendars, especially coaches who put their Zoom link somewhere other than the location or the invite body, and widens the prompt's link check if it misses them.

## Run it on every Friday, per coach

The platform's scheduler sends one `POST /o/{org}/sessions` per coach on Friday afternoon in the coach's time zone, with that coach's agent id as `agent`, the coach's time zone and next week's dates in `input`, and a `request_id` that is a UUID v5 of the coach's id and the week, so a retried job starts no second run. The key's webhook delivers each answer, and the handler puts the list in the coach's dashboard and their Friday email.

A coach who adds sessions over the weekend can press Check again in the dashboard, which sends the same request with a new `request_id` and shows the answer when it arrives.

## Why run it on Rush?

The platform could register its own Microsoft Entra app, ask every coach's IT admin to approve it, and store refresh tokens for each one. With a template, each coach signs in on Microsoft's page to Rush's app, Rush stores and refreshes the token under that coach's agent, and the platform keeps an agent id. A coach's run reaches that coach's calendar and nothing else, and the platform's own Microsoft account is never in it.

Checking a calendar is reading plus judgement: which events are sessions, which link counts, which clash matters. Each coach's run does that in its own computer, all of them on Friday at once, and each session's record keeps the Graph calls it made and its cost, so the platform can answer a coach who asks why a session was or was not flagged.

## Frequently asked questions

### Why calendarView and not the events list?

Microsoft's reference says `calendarView` returns the occurrences, exceptions and single instances of events in a time range, while the events list contains single instance meetings and series masters. A weekly session moved for one week shows up as its own occurrence only in `calendarView`.

### What if a coach does not use categories?

Change the line that says what a session is. Some platforms put a tag in the subject, such as "Session:", and some match on the client's email domain; either goes in the `input` the scheduler sends for that coach.

### Does this work with personal Outlook.com calendars?

Microsoft's `calendarView` reference lists the same least-privileged permission for work or school and personal Microsoft accounts, so the read works on both. A coach who uses Zoom or Google Meet usually puts the link in the event's location or body, which the link check reads.

### Can the agent add the missing Teams link itself?

The token could, because the sign-in includes `Calendars.ReadWrite`, but this prompt forbids it. A change to a session is something the client sees, so it comes from the coach, at a time the coach chooses.

## More Microsoft Calendar jobs

- [How Does Time-Tracking Software Draft Each Consultant's Weekly Timesheet From Their Microsoft Calendar?](https://getrush.ai/run/draft-weekly-timesheet-from-calendar/microsoft-calendar/)
- [Which Jobs Next Week Leave No Time to Drive? Field-Service Software That Checks Each Technician's Microsoft 365 Calendar](https://getrush.ai/run/find-back-to-back-jobs-without-travel-time/microsoft-calendar/)
- [Which Managed IT Clients Are Due a Quarterly Business Review? Read It From Outlook Calendar](https://getrush.ai/run/find-clients-due-a-business-review/microsoft-calendar/)

## More jobs like this: Run an agent per customer task

- [Where Are Last Month's Receipts? A Bookkeeping App Collects Each Freelancer's Emailed Receipts From Their Gmail](https://getrush.ai/run/collect-monthly-receipts-from-email/gmail/)
- [How Does Landlord Software Collect Each Month's Utility Bills From a Landlord's Gmail, Property by Property?](https://getrush.ai/run/collect-utility-bills-for-each-property/gmail/)
- [How Does Estimating Software Collect Each Estimator's Subcontractor Bids From Outlook Before Bid Day?](https://getrush.ai/run/compare-subcontractor-bids-before-bid-day/outlook/)

## Keep reading

- [Connect Microsoft Calendar to Rush once, then name it on any run](https://getrush.ai/integrations/microsoft-calendar/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
