# SkipCalls auth.md

SkipCalls lets an AI agent act for a SkipCalls user through the MCP server or the public REST API. Use OAuth for MCP clients. Use the account flow only when the human has asked the agent to create or operate a SkipCalls account.

## Discover the service

- MCP protected resource: https://be.skipcalls.com/mcp
- Protected Resource Metadata: https://be.skipcalls.com/.well-known/oauth-protected-resource
- Authorization Server Metadata: https://be.skipcalls.com/.well-known/oauth-authorization-server
- Public OpenAPI document: https://be.skipcalls.com/api-public-json
- Human-readable API docs: https://app.skipcalls.com/api-playground

## Method 1: connect an existing account with OAuth

This is the recommended method for ChatGPT, Claude, Gemini, Cursor, and other remote MCP clients. It uses Authorization Code with PKCE S256.

Scopes (space-separated in `scope`):

- `skipcalls:read`: See calls, transcripts, texts and contacts (every connection has it)
- `skipcalls:receptionist`: Change receptionist and account settings
- `skipcalls:actions`: Book appointments, send texts and schedule calls
- `skipcalls:contacts`: Manage contacts, leads, notes and to-dos
- `skipcalls:write`: All three write permissions above

Request only what the agent needs, for example `skipcalls:read skipcalls:actions`. Omitting `scope`, or sending the legacy `mcp` scope, requests full access. Either way the human chooses the permissions on the consent page and can narrow the request; the token response's `scope` says what was granted. A tool outside the granted scopes returns a permission error naming the permission it needs.

1. Configure the MCP client with `https://be.skipcalls.com/mcp`.
2. Discover OAuth from the protected resource metadata.
3. If the client has no client ID, register it at `https://be.skipcalls.com/oauth/register` using OAuth Dynamic Client Registration.
4. Open the authorization URL in a browser. The human signs in or creates an account and approves access.
5. Exchange the returned code at `https://be.skipcalls.com/oauth/token` with the original PKCE verifier.
6. Send the access token as `Authorization: Bearer <access_token>` to `https://be.skipcalls.com/mcp`.

Dynamic client registration body:

```json
{
  "client_name": "Your agent client",
  "redirect_uris": ["https://agent.example.com/oauth/callback"],
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "none",
  "scope": "skipcalls:read skipcalls:actions"
}
```

Registration is rate-limited. Redirect URIs must use HTTPS (or loopback / known native callback schemes) without embedded credentials; the human reviews the redirect host on the consent screen. Public clients must use PKCE S256. Do not send passwords to SkipCalls OAuth endpoints.

## Method 2: create an account for website or REST API automation

The human can create an account at https://app.skipcalls.com/. An authorized browser/API agent can instead use the published curl+jq helper:

```bash
curl -fsSL https://skipcalls.com/agents/skipcalls-agent-curl-cli.sh -o skipcalls-agent.sh
sed -n '1,240p' skipcalls-agent.sh
chmod +x skipcalls-agent.sh
./skipcalls-agent.sh signup --email agent@example.com --password 'generated-long-password'
./skipcalls-agent.sh auth-status
```

Read the complete helper before running it. Account confirmation may require opening the email confirmation link. Store the resulting token file as a secret. Never paste access tokens, refresh tokens, passwords, or payment details into chat or logs.

REST API requests use the signed-in user's Supabase access token as a Bearer token. The public OpenAPI document describes the available REST operations. A long-lived SkipCalls API key is optional and should be created only when the human explicitly requests server-to-server access.

## Credential lifecycle

- OAuth access tokens expire; use the returned refresh token with the `refresh_token` grant.
- If a token receives HTTP 401, discard it and restart discovery and authorization.
- Dynamic OAuth clients expire after 90 days of inactivity; active clients are renewed when tokens are exchanged.
- A blocked or deleted user cannot refresh or use MCP credentials.

## Unsupported registration methods

SkipCalls does not currently advertise anonymous credential issuance, ID-JAG, verified-email identity assertions, or the client-credentials grant. The A2A Agent Card at https://skipcalls.com/.well-known/agent-card.json lists the MCP endpoint as its only interface; there is no A2A message transport. Do not invent those flows or probe registration endpoints with guessed payloads.
