# auth.md — Namepiq agent authentication

You are an agent integrating with **Namepiq** (domain search, quote, checkout).

## Audience
AI agents that need to search, quote, and check out domains via REST or MCP.

## Discovery

1. OAuth Protected Resource Metadata: <https://namepiq.com/.well-known/oauth-protected-resource>
2. OAuth Authorization Server Metadata: <https://namepiq.com/.well-known/oauth-authorization-server>
3. Agent discovery: <https://api.namepiq.com/v1/agent> or <https://namepiq.com/docs/agent.json>
4. MCP Server Card: <https://api.namepiq.com/mcp/server-card>

## Registration (agents)

- Method: email + password (returns Bearer JWT)
- Endpoint: POST https://api.namepiq.com/v1/auth/register
- Body: {"email":"user@example.com","password":"..."}
- After register: verify email via POST https://api.namepiq.com/v1/auth/verify-email
- Credential use: Authorization: Bearer <access_token> on API and MCP

## Login

- Endpoint: POST https://api.namepiq.com/v1/auth/login
- Body: {"email":"user@example.com","password":"..."}
- Response includes access_token (Bearer JWT)

## Google

POST https://api.namepiq.com/v1/auth/google with Firebase ID token {"id_token":"..."}.

## MCP session

Optional Authorization header on https://api.namepiq.com/mcp, or call MCP tools login / register in-session.

## Human pages

- Sign in: https://namepiq.com/login
- Sign up: https://namepiq.com/register
- MCP setup: https://namepiq.com/mcp

## Scopes (logical)

- domains:read — search, quote, status
- domains:write — checkout, watches, manage after purchase

## Rules

- Never invent availability or prices; call search/quote.
- Show payment_url to the human; do not bypass checkout.
