# Peeve > API and MCP documentation for Peeve, an AI customer support agent for SaaS that answers, shows users how on their live screen, does tasks with confirmation, hands off with the full session, and remembers each customer. - [Introduction](https://docs.peeve.ai/get-started/introduction.md): What Peeve exposes to developers: the widget, the server API and the MCP server, what each one solves, and which surface to reach for in your build. - [Quickstart](https://docs.peeve.ai/get-started/quickstart.md): Get started with Peeve: find your publishable key, secret key and API token, install the widget on your pages, then make one authenticated API call. - [Choosing a surface](https://docs.peeve.ai/get-started/surfaces.md): Which Peeve surface fits your goal: the widget script, identify and setContext, the /v1 server API or the MCP server, and the key each one needs. - [Authentication](https://docs.peeve.ai/authentication/overview.md): Peeve's two API keys: the publishable key (pk_) is public and checked by origin; the secret key (sk_) has full workspace authority, server-side only. - [Credentials](https://docs.peeve.ai/authentication/credentials.md): Peeve's three credentials: the publishable key for the widget, the secret key for machine endpoints, and the API token that carries your live role. - [Roles](https://docs.peeve.ai/authentication/roles.md): The Peeve role matrix: what the owner, admin, responder, developer and viewer roles can do, and which role each API endpoint requires on every call. - [Creating and rotating keys](https://docs.peeve.ai/authentication/keys.md): Create, store and rotate Peeve keys. Secret keys are stored hashed and cannot be recovered, so rotation is create-then-revoke with no downtime. - [Origins](https://docs.peeve.ai/authentication/origins.md): How the origin check keeps a Peeve publishable key safe to publish: each widget request's Origin must match the domain set for your workspace. - [Installing the widget](https://docs.peeve.ai/widget/install.md): Install the Peeve widget with one script tag and your publishable key. It boots on DOMContentLoaded with no init() call; the npm package is @peeve/sdk. - [JavaScript API](https://docs.peeve.ai/widget/javascript-api.md): The Peeve widget's JavaScript API: identify, setContext, open and init on window.peeve, and the @peeve/sdk package that boots and queues for them. - [Identity and context](https://docs.peeve.ai/widget/identity-and-context.md): What belongs in identify and what belongs in setContext, how your backend signs a user id so Peeve can act on that account, and how vendor tokens work. - [Customer Brain](https://docs.peeve.ai/widget/customer-brain.md): The Customer Brain is the private memory Peeve keeps for each customer: who they are, recurring issues and how past issues were resolved. - [MCP server](https://docs.peeve.ai/mcp/overview.md): A live Model Context Protocol endpoint over your product's verified capabilities — and what it deliberately will not do. - [Workspace endpoint](https://docs.peeve.ai/mcp/workspace-endpoint.md): The workspace MCP endpoint at mcp.peeve.ai/{workspace}. Takes an API token whose workspace matches the URL, and speaks JSON-RPC over HTTP. - [Per-user grants](https://docs.peeve.ai/mcp/per-user-grants.md): The per-contact MCP endpoint, scoped to one customer's own account. Issue a revocable pv_grant_ token, or use a teammate's API token with reply. - [Connect a client](https://docs.peeve.ai/mcp/connect-a-client.md): Connect Claude, Cursor or any MCP client to Peeve: the endpoint URL, the API token it needs, the config shape, and what to check when it fails. - [Custom MCP connector](https://docs.peeve.ai/mcp/custom-mcp-connector.md): Connect your own MCP server so the Peeve agent can call your tools, including writes, behind a gate that always requires a human confirmation. - [Webhooks](https://docs.peeve.ai/webhooks/outbound.md): Receive Peeve events on your own HTTPS endpoints: the event catalogue, the signed envelope, retries and idempotency, and how to verify a signature. - [Errors](https://docs.peeve.ai/reference/errors.md): Peeve API status codes and error bodies: what 400, 401, 403, 404 and 429 mean, why a 404 is deliberately ambiguous, and the MCP JSON-RPC codes. - [Rate limits](https://docs.peeve.ai/reference/rate-limits.md): Peeve API rate limits: one shared /v1 bucket per credential, MCP limits per workspace and per token, per-plan ceilings, and how to handle a 429. - [Plans and gating](https://docs.peeve.ai/reference/plans.md): Which Peeve features need which plan, from the agent channel on every plan to Scale-only features, and what a workspace does when it is not entitled. - [Data handling reference (API)](https://docs.peeve.ai/reference/data-handling.md): How Peeve handles your data: identity fields like email, name and phone are encrypted per workspace. See what stays plaintext and what is never stored. - [API reference](https://docs.peeve.ai/api/overview.md): The Peeve /v1 API: the base URL https://api.peeve.ai, API token (pv_ut_) authentication sent in a header, and what the server-to-server API covers. - [API conventions](https://docs.peeve.ai/api/conventions.md): The contract every Peeve /v1 endpoint shares: the response envelope, keyset cursor pagination, strict query parameters and one error shape. - [List sessions](https://docs.peeve.ai/api/v1/sessions/list-sessions.md): List agent conversations (sessions), newest first, each one a session you can fetch on its own. Credential: API token · Role: any (read). - [Get a session](https://docs.peeve.ai/api/v1/sessions/get-a-session.md): Get one session, including its transcript of the agent conversation. Credential: API token · Role: any (read), so any team role can call it. - [List contacts](https://docs.peeve.ai/api/v1/contacts/list-contacts.md): List contacts: the people Peeve knows about, both signed-in users and anonymous visitors. Credential: API token · Role: any (read). - [Get a contact](https://docs.peeve.ai/api/v1/contacts/get-a-contact.md): Get one contact by Peeve's contact ID, a UUID, not your external_user_id. To look a contact up by your own ID, use GET /v1/contacts?external_user_id=. - [Set or revoke a contact's vendor token](https://docs.peeve.ai/api/v1/contacts/set-or-revoke-a-contacts-vendor-token.md): Set or revoke the vendor token Peeve holds for one contact, that user's credential for your API. Use Peeve's contact UUID, not your external_user_id. - [Create or update a user](https://docs.peeve.ai/api/v1/users/create-or-update-a-user.md): Create or update one of your users by external_user_id from your backend. Sending an ID again updates it; omitted fields stay. Uses the secret key. - [List leads](https://docs.peeve.ai/api/v1/leads/list-leads.md): List leads, the visitors the Peeve agent qualified. There is no create endpoint: leads come from Peeve's own channels, and you can change their status. - [Get a lead](https://docs.peeve.ai/api/v1/leads/get-a-lead.md): Get one lead, a visitor the Peeve agent qualified, by ID with GET /v1/leads/{id}. Returns the lead object or a 404. Needs an API token; any role can read. - [Update a lead's status](https://docs.peeve.ai/api/v1/leads/update-a-leads-status.md): Update a lead's status, mirroring the status change on the Leads board. Credential: API token · Role: owner or admin (grant). - [List meetings](https://docs.peeve.ai/api/v1/meetings/list-meetings.md): List meetings with GET /v1/meetings, filtered by status (scheduled, completed, canceled, no_show), provider, contact or lead. Any role can read. - [List hand-offs](https://docs.peeve.ai/api/v1/hand-offs/list-hand-offs.md): List hand-offs with GET /v1/handoffs, filtered by status, kind (ticket or chat), requester or session, with cursor pagination. Any role can read them. - [Get a hand-off](https://docs.peeve.ai/api/v1/hand-offs/get-a-hand-off.md): Get one hand-off by ID with GET /v1/handoffs/{id}. Returns the hand-off object, or a 404 if it isn't found. Needs an API token; any role can read it. - [Update a hand-off](https://docs.peeve.ai/api/v1/hand-offs/update-a-hand-off.md): Change a hand-off's status or assignment, as the hand-off console does. Needs an owner, admin or responder API token; developer and viewer are refused. - [Reply to a hand-off](https://docs.peeve.ai/api/v1/hand-offs/reply-to-a-hand-off.md): Reply to a hand-off to answer the customer on the channel they started on, such as email or WhatsApp. It's the only endpoint that messages customers. - [Get usage](https://docs.peeve.ai/api/v1/analytics/get-usage.md): Get credit consumption for the current period, broken down by channel, with GET /v1/usage. It takes no query parameters. Any role can read it. - [List satisfaction responses](https://docs.peeve.ai/api/v1/analytics/list-satisfaction-responses.md): List NPS and CSAT responses from your end users. It's read-only, with no write endpoint, so scores can't be posted in. NPS uses the standard buckets. - [Get guardrails](https://docs.peeve.ai/api/v1/configuration/get-guardrails.md): Get the guardrails: how the Peeve agent is allowed to behave. Credential: API token · Role: any (read), so any team role can call it. - [Update guardrails](https://docs.peeve.ai/api/v1/configuration/update-guardrails.md): Update the agent's guardrails with an owner or admin API token, the same gate the Settings screens use. Strict schemas reject unknown keys, not drop them. - [Get Stripe guardrails](https://docs.peeve.ai/api/v1/configuration/get-stripe-guardrails.md): Read the limits on the agent's Stripe write actions, refunds and coupons. They govern your connected Stripe account, never Peeve's. Any role can read them. - [Update Stripe guardrails](https://docs.peeve.ai/api/v1/configuration/update-stripe-guardrails.md): Update the Stripe guardrails. Credential: API token · Role: owner or admin (manage_team). Money is given in minor units (cents), never decimals. - [Read the kill switch](https://docs.peeve.ai/api/v1/configuration/read-the-kill-switch.md): Read whether the Peeve kill switch is on. The kill switch stops the agent acting on your app. GET /v1/kill-switch with an API token; any role can read it. - [Set the kill switch](https://docs.peeve.ai/api/v1/configuration/set-the-kill-switch.md): Stop or resume Peeve serving. Owners, admins and responders can use it. It stops the agent acting on your app, but never locks you out of this endpoint. - [List webhook endpoints](https://docs.peeve.ai/api/v1/webhooks/list-webhook-endpoints.md): List webhook endpoints. Credential: API token · Role: any (read). The signing secret is never included; secret_hint gives its last 4 characters. - [Create a webhook endpoint](https://docs.peeve.ai/api/v1/webhooks/create-a-webhook-endpoint.md): Register a webhook endpoint for Peeve events. The events list is required; channels is optional and defaults to all. Needs an owner or admin API token. - [Get a webhook endpoint](https://docs.peeve.ai/api/v1/webhooks/get-a-webhook-endpoint.md): Get one webhook endpoint by ID with GET /v1/webhooks/{id}. The signing secret is never returned here; you see it only on create and on rotate. - [Update or pause a webhook endpoint](https://docs.peeve.ai/api/v1/webhooks/update-or-pause-a-webhook-endpoint.md): Update a webhook endpoint, or pause it with enabled: false, which keeps its signing secret and delivery history. Needs an owner or admin API token. - [Delete a webhook endpoint](https://docs.peeve.ai/api/v1/webhooks/delete-a-webhook-endpoint.md): Permanently delete a webhook endpoint and its delivery history. To stop deliveries for a while, set enabled: false; to replace a secret, rotate it. - [Rotate a signing secret](https://docs.peeve.ai/api/v1/webhooks/rotate-a-signing-secret.md): Rotate a webhook signing secret and keep the endpoint ID, subscription and delivery history. The new secret is shown once in the response: store it now. - [Send a test delivery](https://docs.peeve.ai/api/v1/webhooks/send-a-test-delivery.md): Send a signed test event to a webhook endpoint to check that your receiver verifies signatures. It carries livemode: false. Capped at 20 sends an hour. - [List deliveries for an endpoint](https://docs.peeve.ai/api/v1/webhooks/list-deliveries-for-an-endpoint.md): The delivery log: what was sent, the outcome, your response code and the attempts taken. - [Ask the agent a question](https://docs.peeve.ai/api/v1/ask/ask-the-agent-a-question.md): Ask the Peeve agent a question from your backend and get a grounded answer. It returns an answer, never a UI action, and uses credits like any turn. ## OpenAPI Specs - [v1](/openapi/v1.json) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.