# Become Argentine auth.md

How AI agents authenticate with becomeargentine.com. An independent guide to Argentina citizenship by investment. Not part of the Argentine government.

## Who this is for

AI agents that help a person research Argentine citizenship by investment and want to send that person's consultation request to Become Argentine.

## What needs no authentication

- Facts, status and cost: `GET https://becomeargentine.com/api/v1/facts`, `/api/v1/cost`, `/api/v1/health`
- MCP server (read-only tools): `https://becomeargentine.com/mcp`, card at `/.well-known/mcp/server-card.json`
- Every page as markdown: send `Accept: text/markdown`

## What needs a token

`POST https://becomeargentine.com/api/v1/leads` with scope `leads:write`. Without a token it returns 401 with
`WWW-Authenticate: Bearer resource_metadata="https://becomeargentine.com/.well-known/oauth-protected-resource"`.

## Discovery

1. `GET /.well-known/oauth-protected-resource` (RFC 9728): resource, authorization server, scopes.
2. `GET /.well-known/oauth-authorization-server` (RFC 8414): endpoints and the `agent_auth` block.

## Option A: user approves in the browser (recommended)

1. Register a public client: `POST /oauth/register` with `{"client_name": "...", "token_endpoint_auth_method": "none", "redirect_uris": ["https://your-callback"]}`.
2. Send the user to `/oauth/authorize?response_type=code&client_id=...&redirect_uri=...&code_challenge=...&code_challenge_method=S256&state=...`.
   The user sees a consent page and approves one consultation request.
3. Exchange the code: `POST /oauth/token` with `grant_type=authorization_code`, `code`, `redirect_uri`, `client_id`, `code_verifier`.
4. Call `POST /api/v1/leads` with `Authorization: Bearer <access_token>`.

## Option B: anonymous registration and claim

1. Register: `POST /oauth/register` with `{"client_name": "..."}`. You get `client_id`, `client_secret`, `claim_token` and a `claim` object with `user_code` and `verification_uri`.
2. Before the claim you can get a token with `grant_type=client_credentials`. It has scope `facts:read` only.
3. Show the user the `user_code` and the link `https://becomeargentine.com/agent/claim`. The user enters the code to confirm you act for them.
4. Request a new token with `client_credentials`. It now includes `leads:write`.

## Credentials

- Access tokens: ES256 JWT, 1 hour, audience `https://becomeargentine.com`. Keys: `/.well-known/jwks.json`.
- Send tokens only in the `Authorization` header.
- Revoke: `POST /oauth/revoke` with `token=<access_token>`.

## Limits and rules

- Max 2 consultation requests per client per day. Max 5 registrations per IP per day. Global daily caps apply.
- The consent and claim pages use a Cloudflare Turnstile check, so a human must complete them.
- Send only data the user agreed to share. Never submit requests the user did not ask for.
- A request to Become Argentine is not an application to the Argentine government.
