# Outbind auth.md

How an AI agent gets access to Outbind for the person it is helping. Outbind is Obi's brain for sales: it remembers the seller and every prospect, and writes sales emails, reply answers, LinkedIn messages and call scripts on Outbind's side. It never sends anything.

Every account belongs to a person, who proves their email address is theirs. Only make or connect an account for the person you are helping, with their own email, when they asked for it.

## Resource

- MCP server (Streamable HTTP): https://app.outbind.ai/api/mcp
- Brain API (the same tools over HTTP): https://app.outbind.ai/api/v1/brain
- Protected resource metadata (RFC 9728): https://app.outbind.ai/.well-known/oauth-protected-resource
- Authorization server metadata (RFC 8414): https://app.outbind.ai/.well-known/oauth-authorization-server
- A2A agent: https://app.outbind.ai/api/a2a (card: https://app.outbind.ai/.well-known/agent-card.json)

## Method 1: OAuth 2.1 (assistants that can open a browser)

1. Call the MCP server without a token. It answers `401` with a `WWW-Authenticate` header pointing at the protected resource metadata.
2. Register your client with dynamic client registration at https://app.outbind.ai/api/mcp-oauth/register (public client, no secret).
3. Send the person to https://app.outbind.ai/mcp/authorize with PKCE (S256). They sign in, or make a free account, pick what you may do and press Allow.
4. Swap the code at https://app.outbind.ai/api/mcp-oauth/token. Refresh with the refresh token.

Scopes: `mcp:read` (read the brain and prospects, sort replies), `mcp:write` (also every writing tool, prospect memory, lessons, documents and the email checker), `mcp:full`. The person's role in their workspace always limits what a token can do.

## Method 2: agent registration (auth.md service_auth)

For agents that know the person's email but can't open a browser for them. The endpoints are in the authorization server metadata under `agent_auth`.

1. `POST https://app.outbind.ai/api/mcp-oauth/agent/identity` with `{"type": "service_auth", "login_hint": "<email>", "client_name": "<your agent>"}`. The answer has a `claim_token` (keep it in memory, 24 hours) and a `claim` block: `verification_uri`, a 6-digit `user_code` (10 minutes) and `interval` (5 seconds).
2. Show the person the link and the code in one message. They open the link, sign in (or make a free account) with that email, type the code and press Allow.
3. Poll `POST https://app.outbind.ai/api/mcp-oauth/token` with `grant_type=urn:workos:agent-auth:grant-type:claim&claim_token=<clm_...>` every `interval` seconds. `authorization_pending` means wait; `slow_down` means wait longer; `expired_token` means ask `POST https://app.outbind.ai/api/mcp-oauth/agent/identity/claim` with `{"claim_token", "email"}` for a new link and code.
4. Once they allow it, the answer holds an `access_token` (1 hour) and an `identity_assertion` (30 days). For a fresh token, post `grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=<identity_assertion>` to the same token endpoint.

Methods `anonymous` and `identity_assertion` aren't offered (`anonymous_not_enabled`, `issuer_not_enabled`).

## Method 3: emailed code to key (agents that make HTTP requests)

1. `POST https://app.outbind.ai/api/v1/signup` with `{"email": "..."}`. Outbind emails the person a 6-digit code (valid 10 minutes).
2. Ask the person for the code, plus their name and company name.
3. `POST https://app.outbind.ai/api/v1/signup/verify` with `{"email", "code", "name", "company", "timezone", "app"}`. A new account starts on the Free plan (no card). An existing account gets a key for its workspace.

The answer holds a key (`ob_...`, access `mcp_write`), shown once. Never read the person's inbox for the code without their say-so.

Errors: `400` bad input or wrong code, `403` address or network refused, or two-step sign-in is on (use Method 1 or 2), `429` too many tries, `503` agent sign-up is paused (send the person to https://app.outbind.ai/sign-up).

## Using the credential

Send `Authorization: Bearer <token or key>` on every request to the MCP server, the A2A agent or the Brain API. Keep the key where the person keeps secrets (for example an `OUTBIND_API_KEY` environment variable) and never print it in a shared place.

## Revoking

The person sees every connected app and key in https://app.outbind.ai/settings/mcp and can revoke any of them there; access ends at once. OAuth tokens can also be revoked at https://app.outbind.ai/api/mcp-oauth/revoke (RFC 7009).

## More

- Docs for agents: https://outbind.ai/docs/agents.md
- Sign-up details: https://outbind.ai/docs/sign-up.md
- Connect over MCP: https://outbind.ai/docs/connect.md
- Questions: hello@outbind.ai
