<!-- Built by scripts/build-agent-docs.mjs from site/agents-src/co-editing.md: edit that file. -->
# Page Lemon teammates and co-editing: guide for AI assistants

> For people: https://pagelemon.com/docs/team explains this feature in plain words. This page is for AI assistants.

Let other people build a workspace's sites with their own AI (Editors), run the business without editing the sites (Staff), and keep track of who changed what. To let someone look at a draft, share a preview link or passcode. Every site belongs to a workspace and people have a role in the workspace: Owner, Admin, Editor, Staff, or Custom (groups, App and up). There are no site-level roles and no personal plans. Publishing in general: https://pagelemon.com/agents.

Use this when the person says "Invite sam@example.com to edit my site", "Let my designer work on it", "Share my draft with my client so they can look", "Who can edit this site?" or "Remove Sam". Letting people into an invite-only site is a different thing (`user_add`, `user_read` `what=users`; see https://pagelemon.com/agents/protect). Giving a site away is https://pagelemon.com/agents/transfer. Workspaces, groups and seats: https://pagelemon.com/agents/workspaces.

## Plans and limits

How many teammates (seats; every teammate takes one) and how many invites an account sends a day depend on the plan: https://pagelemon.com/pricing. `account_read` `what=account` gives each workspace's seats to its Owner and Admins.

- Pending invites hold their place until accepted or ended (an invite lasts 7 days). Inviting an address that already has a pending invite is refused (`already_invited`); an address already in the workspace is refused too (`already_teammate`).
- Over the limit the reply is `403` `plan_limit` with an `agent_message` that names the limit and `pricing_url` where a bigger plan helps: pass it on. Never retry the same call. Page Lemon has no free trials, and you never start or pay for a plan for the person. Say plan names, never ids.
- One address can be invited 3 times in 24 hours, from any account.
- Custom people (groups) need Company or Enterprise: `team_update` `action=save_group`, then `team_update` `action=invite` with `role: "custom"` and `groups`.

## What each role can and can't do

| Role | Can | Can't |
|---|---|---|
| Owner | Everything, billing included | |
| Admin (App and up) | What an Editor and Staff can, plus people, groups and approving an Editor's script changes | Billing, payouts, refunds, deleting or handing over the workspace, moving sites, changing the Owner |
| Editor (Site and up) | Publish, roll back, upload photos, domains and drafts, read visitor numbers (counts only), leave the workspace; on a sign-in site their HTML or JS waits for an Admin | Invite or remove anyone, change protection or domains, read form replies, bookings, orders or exports (they hold visitors' personal details), download a whole site or publish a copy of it into their own account |
| Staff (App and up; `staff_scan`: scanning only) | Lists and forms, bookings, orders, refund requests, users, scanning, exports, announcements, automations, AI keys | Change the sites, invite people |
| Custom | What their groups allow, on the groups' sites | Anything a group doesn't give |

If an Editor's AI asks for form replies or bookings, the reply refuses: tell the person to ask the Owner, an Admin or Staff.

An Editor can propose a change to a list's structure (removing a field, hiding one, setting rules or public fields) only on Company and up: an Owner or Admin approves it, and only the person whose AI asked can approve a held action of that AI. Below Company the same call from an Editor is `403 forbidden`: tell the person to ask the Owner or an Admin.

## Ask the person

Ask in one message:

- **Who?** The email address of each person, exactly as they will sign in to Page Lemon. A typo sends the invite to a stranger, so read the addresses back.
- **Build, run or both?** `editor`, `staff` (or `staff_scan`), or `admin`. If they say "let my client visit my private site", that is a user of the site (`user_add`), a different list.
- **Which workspace?** Default to the one being discussed.

## What the person needs ready

Nothing but the email addresses. Each invitee needs a Page Lemon login with that same email (free to make) and, to edit with their own AI, their AI connected to Page Lemon: https://pagelemon.com/docs/connect.

## Set it up

MCP: `team_update` `action=invite` with `workspace`, `emails` (up to 100) and `role` (`admin`, `editor`, `staff`, `staff_scan` or `custom`). The first call answers `confirmation_required`: it describes who is invited and with what role. After the person's clear yes in the chat, call again with the `confirm_token`. Page Lemon then emails each invitee, and the Owner gets an email for every invite.

```json
{"workspace": "ws_example", "emails": ["sam@example.com"], "role": "editor"}
```

Invitees accept by signing in with the same email. Until then the invite shows in `team_read` `what=teammates` under `invites`.

## Confirm with the person

Before the first call, say in plain words who will be invited, with which role and what that role can do (above). Removing people is held for the person's own click: `team_remove` `action=remove` with `teammate` (one account id a call) and `etag` (theirs from `team_read` `what=teammates`) answers `confirmation_required` first, then after the yes returns `approval.url`; give the link exactly as it is, and the person confirms it signed in to the Dashboard. Access ends as soon as they do.

## Test

After the invitee has accepted, `team_read` `what=teammates` shows them with their role. To prove an Editor can work, they publish a small change; `site_read` `what=versions` then shows who made it. Don't say the person is an Editor until `team_read` `what=teammates` shows them.

## Day to day

- `team_read` `what=teammates`: the workspace's people, roles and pending invites.
- `user_read` `what=users` and `user_remove`: the people who sign in to a site, a different list (users, not teammates).
- Who changed what: `site_read` `what=versions` (each version records who published it and from which app); `analytics_read` `what=activity` shows people changes too (https://pagelemon.com/agents/activity).
- Nobody overwrites anyone: a `site_publish` with a stale `base_version` is a `409 version_conflict` saying who changed what and when. Read the site again, merge and redeploy only if the person agrees. Rolling back adds a new version.
- Turn AI invites off or on for a workspace: `team_update` `action=ai_invites` with `workspace` and `on` (`false` takes effect at once; `true` is held: the call answers `202` with `approval.url` and the person confirms, then `account_read` `what=approval`), or the Owner or an Admin unticks it in the app (**People**). While off, an AI call to invite answers `403` `ai_invites_off`. The person can still invite from the app, and removing people keeps working.

## What Page Lemon refuses, and the fix

| Refused | Fix to offer |
|---|---|
| More people than the plan allows (`plan_limit`) | Remove someone first, or the plan the reply names |
| Inviting from an AI when AI invites are off (`ai_invites_off`) | The person invites from the app, or turns AI invites back on |
| An Editor or Staff trying to invite, remove or change settings | Ask an Owner or Admin |
| An Editor reading form replies, bookings or orders | Ask the Owner, an Admin or Staff to forward what is needed |
| An Editor downloading a whole site, or publishing its pages as a new site of their own | Edit the site itself, or ask an Owner or Admin for a copy |
| The address is already in the workspace (`already_teammate`) or already invited (`already_invited`) | Nothing to do: they have access already or can accept the invite waiting |
| The same address invited 3 times in 24 hours, or the account's invites a day used up | Wait; the reply says when |
| A key or connection limited to other workspaces | A key or connection that reaches this workspace (https://pagelemon.com/docs/api-tokens) |
| The invitee signs in with a different email than the one invited | Invite the address they use, or have them sign in with the invited one |

## Links

- For the person: https://pagelemon.com/docs/team
- Handing a site over: https://pagelemon.com/agents/transfer · Workspaces: https://pagelemon.com/agents/workspaces
- API: https://pagelemon.com/docs/api · MCP tools: https://pagelemon.com/docs/mcp
- All AI guides: https://pagelemon.com/agents
