> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peel.sh/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Peel builds APIs from a URL and a task. Use only the REST routes under https://api.peel.sh and the hosted MCP server at https://api.peel.sh/mcp. Authenticate with the X-API-Key header, or send the same key as Authorization: Bearer. Errors carry code, message, retryable, retry, docs_url and details; branch on code. The peel CLI and the open-source SDK are not published; do not run npm install peel, which is an unrelated package. The keyless routes need no key and no session: the GET /public/marketplace routes, POST /v1/marketplace/{marketplace_id}/endpoints/{endpoint_name}:call and https://api.peel.sh/mcp/keyless. Account routes take a key or a signed-in session and answer 401 without one. These take only a session from peel.sh and refuse a key: GET /v1/accounts, POST /v1/accounts/join, POST /v1/accounts/{account_id}/leave, POST /v1/team/invites, GET /v1/connected-apps, DELETE /v1/connected-apps/{client_id}, PUT /v1/logins, DELETE /v1/logins, GET /v1/logins/code and the /account/billing routes. Every route with its schemas is in https://docs.peel.sh/openapi.json. Use the exact route, field and error-code names shown in these pages, and read the API Reference tab for request and response schemas.

# Teams

> Invite people to your account, give each a role, and act on a team's APIs from the app or a key.

Every Peel account is a team of one. Invite people and they act on your account: its APIs, saved logins, webhooks, keys and allowance. Runs and builds by any member count against the owner's plan.

## Roles

| Role | Can |
| - | - |
| Owner | Everything, including billing, keys with full access and deleting the account. One per team: the account's own user. |
| Admin | Build, run, saved logins, webhooks, read usage, manage keys up to their own access, invite and remove people. Not billing. |
| Member | Build, run, use and change saved logins, read usage. |
| Tool user | Run endpoints and read APIs. Cannot build or see saved logins. |

A role is a set of the same permissions keys use ([Authentication](https://docs.peel.sh/getting-started/authentication.md)). A request a role does not allow answers `403 role_permission_missing` with `details.role` and `details.required_permission`.

## Invite someone

Invitations are sent from the app (Settings, Team), or with a signed-in session:

```bash theme={null}
POST /v1/team/invites
{ "email": "ana@example.com", "role": "member" }
```

Peel emails a link that works for 7 days and only for that address. The answer carries the `invite_url` too, so you can send it yourself. Inviting the same address again replaces the old link. A team has at most 25 people besides its owner and 50 open invitations. API keys cannot invite people.

The invited person signs in with that address and opens the link, which calls `POST /v1/accounts/join` with the token. A link for another address answers `403 invite_email_mismatch`; an expired or revoked one answers `404 invite_not_found`.

## Act on a team

In the app, open **Team** from the account menu and pick the team under **Acting on**; Billing is hidden while you act on a team, and **Back to your account** returns to your own. Keys you create in Settings while acting on a team belong to the team. Over the API with a session, send the team's account id in a `Peel-Account` header; `GET /v1/accounts` lists the accounts you can act on. A session that is not on the team answers `403 team_access_denied`. An API key always acts on the account that owns it, so a key request that sends `Peel-Account` answers `400 account_header_with_key`.

A key always acts on the account that made it. Create keys for a team with `POST /v1/keys` while acting on it; a key never gets more access than the person or key that made it (`403 key_access_too_wide`). Add `api_id` to limit the key to one of the team's APIs ([Keys for one API](https://docs.peel.sh/getting-started/authentication.md#keys-for-one-api)).

## Manage the team

| Route | Who | Does |
| - | - | - |
| `GET /v1/team` | Everyone on the team | The owner, members with roles, and open invitations. |
| `POST /v1/team/invites` | Owner, admin; session only | Invites an address with a role. |
| `DELETE /v1/team/invites/{id}` | Owner, admin | Revokes an invitation. |
| `PATCH /v1/team/members/{user_id}` | Owner, admin | Changes a member's role. |
| `DELETE /v1/team/members/{user_id}` | Owner, admin | Removes a member. |
| `GET /v1/accounts` | You | Your own account and the teams you are on. |
| `POST /v1/accounts/{account_id}/leave` | You | Leaves a team. |

A changed role or a removal applies within 5 seconds.

## Audit log

Peel records who changed what on the account: creating, changing and deleting APIs, saved logins, webhooks, keys and team members, and MCP tools that change something. Each event has the time, the person or key that did it (`actor`), the action as method and route, the target id and the status code. A key limited to one API that is refused is recorded where it is refused, with status `403` for a route and the JSON-RPC error code `-32600` for an MCP tool call, `tasks/cancel`, or each refused call inside a JSON-RPC batch. Calls and runs are not in it; each run carries its own `actor` in [Runs](https://docs.peel.sh/features/runs.md).

```bash theme={null}
curl "https://api.peel.sh/v1/audit-events?limit=50" -H "X-API-Key: $PEEL_API_KEY"
```

```json theme={null}
{
  "events": [
    {
      "id": "kn7f0z3rq6p0w2c1v9m4t8s5ad7jx2hy",
      "at": "2026-11-17T09:12:40.118Z",
      "actor": { "type": "session", "user_id": "ana_user_id", "email": "ana@example.com" },
      "action": "PATCH /v1/team/members/:userId",
      "target": "ben_user_id",
      "status": 200
    }
  ],
  "next_cursor": null
}
```

Reading it needs the `team:manage` permission, so owners, admins and full-access keys. Events are kept 90 days. Page with `next_cursor` as `cursor`, 1 to 100 per page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.