All jobs

Propose Interview Times From Each Recruiter's Microsoft 365 Calendar

Recruiting software makes one agent per recruiter, signed in to their Microsoft 365 calendar, that finds three interview times the whole panel is free.

Run this on RushOpens the console with this prompt ready to send. Connect Microsoft Calendar there first.

What the agent does

This is for a company that sells an applicant tracking system to staffing and recruiting agencies. Its users are recruiters who live in Outlook and Teams, and the slowest part of their day is the back-and-forth of finding an hour when a candidate's interview panel is free. The company saves one agent as a template, POST /o/{org}/agents {"name": "Interview slots", "harness": "claude", "instructions": "…", "connections": ["microsoft-calendar"]}, after connecting a Microsoft Calendar of its own, because a template can only name connections its creator has. When a recruiter turns the feature on, the backend makes their agent with {"template": "<template id>", "name": "slots-<your user id>"} and keeps the returned id against that recruiter.

The recruiter then connects their own calendar. The backend calls POST /o/{org}/agents/{agent}/connections {"type": "app", "name": "microsoft-calendar"} and opens the authorize_url it returns in a popup for that signed-in recruiter, who approves Rush on Microsoft's own sign-in page. Rush asks for one Microsoft Graph permission for this app, Calendars.ReadWrite, and nothing for mail or files. The agency registers no app in Microsoft Entra and never stores a Microsoft token.

When the recruiter clicks "Find times" on a candidate, the app starts a run of that recruiter's agent with the panel's email addresses, the recruiter's own address, the interview length and the window in input. The agent calls Microsoft Graph's POST /me/calendar/getSchedule with the recruiter and the interviewers in schedules, the window as startTime and endTime, and availabilityViewInterval set to the interview length. Each answer carries the person's scheduleItems with a status of free, tentative, busy, oof or workingElsewhere, and their workingHours with days, start, end and time zone, so the agent keeps only slots inside every panelist's working hours and treats tentative as a soft conflict it reports rather than ignores.

It ranks what is left: slots where nobody is tentative first, then earlier days, and it avoids the first and last half hour of anyone's working day. It places one hold on the recruiter's own calendar for the best slot, an event with showAs set to tentative and no attendees, so no invitation goes to anyone and the hour stays free until the recruiter decides. It sends nothing to the candidate: the recruiter picks a time in the app and sends the invite from there.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "<agent id>",
  "input": "Find three 60-minute interview slots between 2026-11-17 and 2026-11-21 for a panel of maria.lopez@agency.example, dev.patel@agency.example and the recruiter, sam.reed@agency.example. Call POST /me/calendar/getSchedule with all three addresses in schedules, availabilityViewInterval 60, and the Prefer header for Eastern Standard Time. Keep only slots inside every panelist's workingHours. Rank slots with nobody tentative first, then earlier days, and avoid the first and last 30 minutes of anyone's working day. Create one event on the recruiter's own calendar for the best slot, subject 'Hold: interview', showAs tentative, with no attendees. Invite no one and change no other event. Return only JSON: slots (3, each with start, end, time_zone and tentative_people), hold_event_id, and unavailable (any address getSchedule could not read, with its error)."
}
  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, with your repository as the resources URL. 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 answer is that JSON, in the session's result and in the run.completed webhook's data.result. The app matches the webhook's execution_id to the candidate it started the run for and shows the three slots next to the candidate's profile, with any tentative_people beside a slot so the recruiter can see the soft conflict. The app keeps hold_event_id, so a later run of the same agent can delete that one hold when the recruiter picks another slot.

What the recruiter checks before inviting: that the slot suits the candidate's own time zone, which the agent was not given, and that an interviewer listed in unavailable is real. Free and busy for people outside the recruiter's Microsoft 365 organization depends on what their admin shares, and getSchedule does not work for personal Microsoft accounts at all, so a panel member on an outside domain often comes back unreadable and needs a manual check.

The session's accounts field names the Microsoft account the run acted as, and the transcript keeps every Graph call and the event it created, so when a recruiter asks why Tuesday at 10 was not offered, support can see the busy block that ruled it out.

Run it on every recruiter clicks Find times

One run per click: the app's backend sends POST /o/{org}/sessions with the recruiter's agent id and the panel in input, plus a request_id that is a UUID v5 of the candidate's id and the interview stage, so a double click or a retried request returns the run already started instead of placing a second hold.

A recruiter who never finished connecting gets 422 CONNECTION_NOT_READY before a sandbox starts, and one who revoked Rush in their Microsoft account shows needs_reauth on GET /o/{org}/agents/{agent}/connections. The app catches both and puts a "Reconnect Outlook calendar" button in place of the slots, which starts a fresh sign-in.

The use case this job follows, with its automation and trigger: Run an agent per customer task.

Why run it on Rush?

Scheduling looks like a small feature until it has to read hundreds of recruiters' calendars. Built in-house, it means an app registration in Microsoft Entra, admin consent conversations with each agency, storing and refreshing tokens per recruiter, and making sure one recruiter's calendar never answers for another. On Rush each recruiter's account belongs to their own agent: its runs see that calendar and nothing else, Rush refreshes the token, and the product stores only agent ids.

Each run has its own computer, its own transcript and its own cost, so a slot the agent offered can be traced to the Graph answer behind it. GET /o/{org}/sessions?agent=<agent id> lists one recruiter's runs with total_cost_usd, which lets the company see what the feature costs per seat. When a recruiter leaves an agency, DELETE /o/{org}/agents/{agent} removes their agent and disconnects their calendar.

Frequently asked questions

Can it see interviewers' calendars outside the agency?

It asks Graph for whatever addresses the app passes, and Graph answers with what that person's organization shares. Colleagues in the recruiter's own Microsoft 365 organization usually come back with free and busy blocks; outside addresses often do not, and the agent lists them under unavailable instead of guessing.

Does the candidate get an invitation from the agent?

No. The prompt has it create a single hold with no attendees, and Outlook sends invitations only to attendees. The recruiter chooses the slot and sends the invite from the app, so a person stays in charge of what reaches the candidate.

Does this work for recruiters on personal Outlook.com accounts?

Not with getSchedule, which Microsoft supports for work and school accounts only. For a personal account the template's instructions can read the recruiter's own events with calendarView instead, but then the panel's availability is not visible.

What happens to the holds that never become interviews?

They stay on the recruiter's calendar as tentative events titled "Hold: interview" until someone deletes them. The app never holds a Microsoft token, so it removes a hold by starting a short run of the same agent with hold_event_id in input when the recruiter picks another slot or closes the candidate.

More Microsoft Calendar jobs

More jobs like this: Run an agent per customer task

Keep reading