# patio

> A private relationship keeper: track how often you want to see the people you care about, log meetups, get a weekly nudge when someone slips, and schedule meetings that fit everyone's calendar. Every page action is also a JSON REST API call.

## How to operate this site

- Signed in as the person whose browser this is: call the API from a page of this site with fetch(url, { credentials: "same-origin" }). The session cookie is the credential.
- Send JSON: `content-type: application/json` on every POST, PUT, PATCH and DELETE that has a body. Cross-site writes are refused.
- Times in responses are epoch milliseconds (UTC). Input times take epoch milliseconds or ISO 8601 with an offset.
- Errors: `{ "error": { "code", "message", "issues"? } }` with 400 (input), 403, 404 (missing or not yours), 409 (duplicate), 429 (rate limit).
- Invitations, meetings, connection requests and group invites send real email to real people. Confirm with the human before you send them, and before you delete anything.
- Prefer the API over clicking: read with GET, change with the listed calls, then reload the page so the human sees the result.
- Not signed in (401)? Ask the human to sign in at /sign-in. The API has no sign-in call.

Example, from the browser console of any page of this site:

```js
const people = await (await fetch("/api/v1/people")).json();
await fetch("/api/v1/interactions", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ date: "2026-10-18", channel: "in_person", people: [{ personId: people[0].personId, mood: 4 }], note: "Her new job at the museum.", promisedByMe: "Send her the photographer's number." }) });
```

## Tasks

Step-by-step recipes with the API calls. Read with GET freely; ask the human before every change.

### AI calls

- AI help is off by default. GET /settings: `aiAvailable` false means this server has no AI; skip every AI step. `aiHelp` false means the human did not turn it on: ask them before PUT /settings/ai-help { enabled: true }, and tell them what goes to `aiService`.
- At most 50 AI calls per 24 hours for both AI calls together (429). Spend them on the people the human picks, not on everyone.
- AI output is a suggestion. Show it to the human; save only what they choose. Nothing is saved by the AI calls themselves.

### Weekly review

Once a week, for example on Monday: who to see, what you owe, who seemed low. The human's page for it is /app/review; these calls give the same.

1. `GET /api/v1/home`: `due` (slipping or overdue, the most overdue first), `followUps` and `followUpCounts`, `alerts` (who seemed low twice), `toRate` (meetups without a rating), `connectionRequests`.
2. `GET /api/v1/follow-ups`: With `?horizonDays=7`: everything open that is overdue, undated or due this week, with who it is about. Group the lines by `personName` for the human.
3. `GET /api/v1/people/{personId}/brief`: For each person the human wants to see: the last meetup, open follow-ups, mood lately, birthday within 30 days.
4. `POST /api/v1/people/{personId}/ai/ideas`: Optional, AI: up to 3 questions or follow-ups for next time, from the notes of the last meetups. Only for the people the human picks.
5. `POST /api/v1/people/{personId}/open-questions`: Save an idea the human chose; it becomes a follow-up.
6. `PATCH /api/v1/follow-ups/{followUpId}`: Tick off what is done ({ "done": true }) or give it a date ({ "dueOn": "YYYY-MM-DD" }), as the human says.
7. `POST /api/v1/interactions/{interactionId}/rating`: Rate each meetup of `toRate` the human remembers (eventAffect 1-5, or null to skip).
8. `POST /api/v1/meetings`: Find a time with someone due. It emails them: confirm with the human first.
9. `POST /api/v1/people/{personId}/snooze`: Someone away (travel, a hard month)? { "days": 14 } pauses their nudges and takes their follow-ups off Home and the reminders. Ask the human first.

- Report in a few lines: who is due and since when, what is overdue, who seemed low, and one idea per person if there are ideas. Then ask what to do.
- Never change a cadence because of a mood; only suggest it.

### Before you meet someone

A meeting is coming up, or the human says they will see someone.

1. `GET /api/v1/people`: Find the person by `name`; take their `personId`.
2. `GET /api/v1/people/{personId}/brief`: What to remember: the last meetup's note and plans, open follow-ups, mood lately, interests, birthday.
3. `POST /api/v1/people/{personId}/ai/ideas`: Optional, AI: questions to ask this time.

### After a meetup

The human tells you about a meetup, or pastes notes.

1. `GET /api/v1/interactions`: With `?personId=`: check that this meetup is not already there (a meeting or calendar may have logged it). If it is, add the notes with PATCH /interactions/{interactionId}.
2. `POST /api/v1/ai/sort-note`: Optional, AI: split a long note into plans, decisions, open questions and promises. Show the result; the human agrees or edits it.
3. `POST /api/v1/interactions`: Log it with the agreed fields. Each line of promisedByMe, promisedToMe and openQuestions becomes a follow-up. At a group meetup, start a line with a first name and a colon ("Ann: send the photos") so it is about that person.

### A promise made by message

The human promised something, or was promised something, outside a meetup.

1. `GET /api/v1/people`: Find the person by `name`; take their `personId`.
2. `POST /api/v1/people/{personId}/follow-ups`: { "kind": "by_me" | "to_me" | "question", "text": one line, "dueOn"?: "YYYY-MM-DD" }. It is a follow-up by itself: no meetup, so the cadence does not change.
3. `DELETE /api/v1/follow-ups/{followUpId}`: Remove one by itself the human no longer wants (one from a meetup goes by editing the meetup's notes).

## API

- [OpenAPI 3.1 spec](https://patio.serve.beshu.tech/api/v1/openapi.json): every operation with its JSON input schema

### Account

- `GET /api/v1/me`: Who is signed in, unread notifications, and whether setup is still open
- `GET /api/v1/home`: The home dashboard: who is due, meetups to rate, follow-ups, gentle alerts, connection requests, merge suggestions
- `POST /api/v1/setup/finish`: Close the first-run setup wizard
- `GET /api/v1/export`: Everything stored about you, as JSON
- `PUT /api/v1/me/photo`: Set your own picture (shown to the people you are connected to)
- `DELETE /api/v1/me/photo`: Remove your own picture
- `PUT /api/v1/me/photo-lookup`: Turn picture lookups for your contacts on or off
- `DELETE /api/v1/me`: Delete your account for good
- `POST /api/v1/home/dismissals`: Hide a home alert or suggestion for good

### Connections

- `GET /api/v1/connections/requests`: Connection requests sent to you and by you
- `POST /api/v1/connections/requests`: Ask someone to connect, by email (emails them when they have no account)
- `POST /api/v1/connections/requests/{requestId}/respond`: Accept or decline a connection request
- `DELETE /api/v1/people/{personId}/connection`: Remove the connection with an account person
- `GET /api/v1/blocks`: Accounts you blocked
- `POST /api/v1/blocks`: Block an account (ends the connection, hides their invitations)
- `DELETE /api/v1/blocks/{userId}`: Unblock an account
- `PUT /api/v1/mutes/{userId}`: Mute or unmute an account

### Notifications

- `GET /api/v1/notifications`: Your notifications, newest first, 50 per page
- `POST /api/v1/notifications/read`: Mark notifications as read

### Settings

- `GET /api/v1/settings`: Your preferences and weekly hours
- `PATCH /api/v1/settings`: Change any preferences; fields you leave out keep their value
- `POST /api/v1/settings/guest-history`: Add (or not) the meetings you were invited to as a guest before you had an account
- `PUT /api/v1/settings/ai-help`: Turn AI help (Sort with AI, Ideas for next time) on or off

### Calendars

- `GET /api/v1/calendars`: Connected calendar accounts and their calendars
- `POST /api/v1/calendars/ics`: Connect a calendar by its ICS or webcal link (busy times only)
- `PUT /api/v1/calendars/{calendarId}/busy`: Count (or stop counting) one calendar's events as busy
- `PUT /api/v1/calendars/{calendarId}/destination`: Put meetings and reminders in this calendar
- `DELETE /api/v1/calendar-accounts/{accountId}`: Disconnect a calendar account and all its calendars

### People

- `GET /api/v1/people`: List everyone you keep track of
- `POST /api/v1/people`: Add a private contact, with any field of PATCH /people/{personId}
- `POST /api/v1/people/bulk`: Add up to 200 private contacts at once (all or none)
- `GET /api/v1/people/merge-candidates`: Private contacts that look like the same person as a connection
- `GET /api/v1/people/{personId}`: One person: summary, how you met, what they are like, details, recent meetups with notes, tags, mute and block state
- `PATCH /api/v1/people/{personId}`: Change any field of a person, all or nothing
- `DELETE /api/v1/people/{personId}`: Delete a private contact and everything private about them
- `PUT /api/v1/people/{personId}/photo`: Set your own picture of a person (private to you)
- `DELETE /api/v1/people/{personId}/photo`: Remove the picture you set of a person
- `PUT /api/v1/people/{personId}/identity`: Rename a private contact or change their email (PATCH /people/{personId} does the same)
- `PUT /api/v1/people/{personId}/about`: Relationship, birthday, how you met, what they are like, contact details and shared interests (PATCH /people/{personId} does the same)
- `POST /api/v1/people/{personId}/snooze`: Pause nudges about a person for some days (0 ends the snooze); their follow-ups leave Home and the reminders until then
- `POST /api/v1/people/{personId}/check-in`: Answer the cadence check-in: keep it, change it, or stop tracking
- `POST /api/v1/people/{personId}/merge`: Merge a private contact into another person (see /people/merge-candidates)
- `GET /api/v1/people/{personId}/brief`: What to remember before you meet someone

### Tags

- `GET /api/v1/tags`: Your tags, each with the people who carry it
- `POST /api/v1/tags`: Put a tag (new or existing) on people
- `PATCH /api/v1/tags/{tagId}`: Rename a tag (merges into a tag that already has the new name)
- `DELETE /api/v1/tags/{tagId}`: Delete a tag (people stay)
- `POST /api/v1/people/{personId}/tags`: Tag one person
- `DELETE /api/v1/people/{personId}/tags/{tagId}`: Take a tag off one person

### Meetups

- `GET /api/v1/interactions/prompts`: Recent meetups waiting for a rating (newest first, at most 5)
- `GET /api/v1/interactions`: Your meetups with their notes, newest first; optionally only those with one person, or a search
- `GET /api/v1/interactions/{interactionId}`: One meetup with all your notes
- `POST /api/v1/interactions`: Log a meetup ("I met…") with your notes
- `PATCH /api/v1/interactions/{interactionId}`: Change the notes, channel, ratings or (for meetups you logged) the date, the people and the party size of a meetup
- `POST /api/v1/interactions/{interactionId}/rating`: Rate a meetup (null skips the rating and closes the prompt)
- `POST /api/v1/interactions/{interactionId}/people/{personId}/mood`: Set how one person in a meetup seemed to you (their mood)
- `POST /api/v1/interactions/{interactionId}/people/{personId}/rating`: How it felt for you with this person (legacy; prefer mood and eventAffect)
- `DELETE /api/v1/interactions/{interactionId}`: Delete a meetup and its notes ("I did not go")

### Follow-ups

- `GET /api/v1/follow-ups`: Your follow-ups: what you promised, what they promised, open questions
- `PATCH /api/v1/follow-ups/{followUpId}`: Tick a follow-up done (or open again), or give it a due date
- `POST /api/v1/people/{personId}/follow-ups`: Add a follow-up by itself about someone: a promise or question with no meetup behind it
- `DELETE /api/v1/follow-ups/{followUpId}`: Remove a follow-up by itself
- `POST /api/v1/people/{personId}/open-questions`: Add an open question about someone, as a follow-up

### AI

- `POST /api/v1/ai/sort-note`: Sort one "What you talked about" note into plans, decisions, open questions and promises, for review
- `POST /api/v1/people/{personId}/ai/ideas`: Ideas for next time with someone: questions to ask or things to follow up on, for review

### Meetings

- `GET /api/v1/meetings`: Meetings you organize or were invited to, soonest first
- `POST /api/v1/meetings`: Create a meeting and invite people, groups or email addresses
- `GET /api/v1/meetings/{meetingId}`: One meeting: details, the participants you may see, dates, open poll and your RSVPs
- `PATCH /api/v1/meetings/{meetingId}`: Organizer: change any of title, description, durationMin, where, location, videoUrl, repeat, searchDays, people, groups, emails for the whole meeting
- `GET /api/v1/meetings/{meetingId}/times`: Organizer: free times for everyone who shares availability
- `POST /api/v1/meetings/{meetingId}/confirm`: Organizer: confirm the start time (sends the confirmation and calendar invites)
- `POST /api/v1/meetings/{meetingId}/poll`: Organizer: let invitees vote on 2 to 4 start times
- `POST /api/v1/meetings/{meetingId}/cancel`: Organizer: cancel the whole meeting (tells everyone)
- `POST /api/v1/meetings/{meetingId}/respond`: Invitee: accept or decline
- `POST /api/v1/meetings/{meetingId}/rsvp`: Participant: RSVP to one date of a meeting
- `POST /api/v1/occurrences/{occurrenceId}/move`: Organizer: move one date
- `POST /api/v1/occurrences/{occurrenceId}/split`: Organizer: move this date and every later one of a series
- `POST /api/v1/occurrences/{occurrenceId}/cancel`: Organizer: cancel one date

### Groups

- `POST /api/v1/meetings/{meetingId}/join`: Group member: opt in to a group meeting series
- `GET /api/v1/groups`: Groups you belong to or asked to join
- `POST /api/v1/groups`: Create a group (you become its owner)
- `GET /api/v1/groups/{slug}`: One group by slug: members and meetings when you are an active member, else the join view
- `PATCH /api/v1/groups/{groupId}`: Admin: change the group's name, description or who can join; fields you leave out keep their value
- `POST /api/v1/groups/{groupId}/join`: Join (open group) or ask to join (request group)
- `POST /api/v1/groups/{groupId}/leave`: Leave a group (the last member leaving deletes it)
- `PUT /api/v1/groups/{groupId}/subscription`: Get or stop emails about new group meetings
- `POST /api/v1/groups/{groupId}/members/{userId}/approve`: Admin: approve a join request
- `PUT /api/v1/groups/{groupId}/image`: Admin: set the group's picture (members and anyone who can open the join page see it)
- `DELETE /api/v1/groups/{groupId}/image`: Admin: remove the group's picture
- `POST /api/v1/groups/{groupId}/invitations`: Admin: invite someone by email
- `POST /api/v1/group-invitations/{token}/accept`: Accept a group invitation (the token is the last part of the /g/<token> link)
- `POST /api/v1/groups/{groupId}/meetings`: Admin: start a group meeting series (members opt in; people and emails are invited as well)

## Pages

- [/app](https://patio.serve.beshu.tech/app): Home: who is due for a meetup, meetups to rate, connection requests
- [/app/people](https://patio.serve.beshu.tech/app/people): Everyone you keep track of; search, filter by tag (?tag=) or by shared interest (?interest=climbing)
- [/app/people/new](https://patio.serve.beshu.tech/app/people/new): Add a person or send a connection request
- [/app/people/{personId}](https://patio.serve.beshu.tech/app/people/): One person: cadence, mood lately, notes, birthday, how you met, what they are like, shared interests, contact details, open follow-ups, meetings coming up, tags, recent meetups
- [/app/people/{personId}/meetups](https://patio.serve.beshu.tech/app/people/): Every meetup with one person, newest first, with your notes
- [/app/log](https://patio.serve.beshu.tech/app/log): Log a meetup ("I met…"); ?with={personId} (repeatable) picks people
- [/app/review](https://patio.serve.beshu.tech/app/review): Weekly review: who is due with what is open with them, what else is due this week, who seemed low, meetups to rate; J and K move between people
- [/app/follow-ups](https://patio.serve.beshu.tech/app/follow-ups): Follow-ups: what you promised, what they promised and open questions from your meetups; tick them off, give them a date
- [/app/meetups](https://patio.serve.beshu.tech/app/meetups): All your meetups, newest first; ?q= searches your notes and the names of who was there (GET /interactions?q= is the API)
- [/app/meetups/{interactionId}](https://patio.serve.beshu.tech/app/meetups/): One meetup: read and edit what you talked about, plans, decisions, promises, who was there and moods; tick off follow-ups; delete it
- [/app/meetings](https://patio.serve.beshu.tech/app/meetings): Your meetings and calendar
- [/app/meetings/new](https://patio.serve.beshu.tech/app/meetings/new): Find a time: create a meeting and invite people; ?with={personId} (repeatable) or ?tag= picks them
- [/app/meetings/{meetingId}](https://patio.serve.beshu.tech/app/meetings/): One meeting: respond, confirm a time, poll, RSVP, move or cancel dates
- [/app/groups](https://patio.serve.beshu.tech/app/groups): Your groups
- [/app/groups/{slug}](https://patio.serve.beshu.tech/app/groups/): One group: members, meetings, invitations
- [/app/notifications](https://patio.serve.beshu.tech/app/notifications): Notifications
- [/app/settings](https://patio.serve.beshu.tech/app/settings): Name, time zone, weekly hours, nudges, calendars, blocked accounts, export, delete account
- [/app/setup](https://patio.serve.beshu.tech/app/setup): First-run setup wizard

## Optional

- [Manifesto](https://patio.serve.beshu.tech/manifesto): why the product exists
- [Insights](https://patio.serve.beshu.tech/insights): articles
