# Developer docs

Closefinch is built to be used by programs and AI agents as well as people. Everything below works with an
account on any plan, including Free.

## REST API

- **Spec:** OpenAPI 3.1 at [https://www.closefinch.com/openapi.json](https://www.closefinch.com/openapi.json). It lists every route, the scope each
  one needs, request and response schemas, and the rate limits.
- **Base URL:** `https://api.closefinch.com/v1`
- **Authentication:** `Authorization: Bearer ra_live_…`. An owner creates keys in Settings → API keys and
  chooses their scopes. A key never has more access than the person who made it, and it stops working when
  they leave. Details: [Authentication](https://www.closefinch.com/docs/authentication).
- **IDs** are opaque and prefixed (`acct_…`, `ct_…`, `deal_…`). Lists use cursor pagination.
- **Errors** say what went wrong and what to do next: `{ "error": { "code": "…", "message": "…" } }`.
- **Writes that send something** (email, CRM updates in other systems) go through the same policy engine and
  approval inbox as the app.

## MCP server

Connect Claude, ChatGPT, Cursor or any MCP client to `https://api.closefinch.com/mcp` (Streamable HTTP). Clients sign in with OAuth,
registering themselves, or send an API key. Details: [MCP server](https://www.closefinch.com/docs/mcp).

## CLI

The `ra` command line covers every resource, signs in with OAuth profiles or a key, prints JSON, and has a
built-in `--jq`. `ra install claude-code` writes a project's `.mcp.json` and a skill for Claude Code; it
references `${RA_API_KEY}`, never the key itself. Install and every command: [CLI](https://www.closefinch.com/docs/cli).

## Webhooks

- **Outbound:** subscribe to record and agent events. Every delivery is signed per Standard Webhooks
  (`webhook-id`, `webhook-timestamp`, `webhook-signature`).
- **Inbound:** start an agent from any system with a webhook trigger, authenticated by the trigger's secret
  (`Authorization: Bearer …`). Zapier, Make and n8n work too.

Signing, retries and the event list: [Webhooks](https://www.closefinch.com/docs/webhooks).

## Machine-readable files

- [llms.txt](https://www.closefinch.com/llms.txt) and [llms-full.txt](https://www.closefinch.com/llms-full.txt)
- [pricing.json](https://www.closefinch.com/pricing.json) and [pricing.md](https://www.closefinch.com/pricing.md)
- Every page has a Markdown version: add `.md` to its path (`/pricing.md`, `/index.md` for the home page) or
  send `Accept: text/markdown`.
- [security.txt](https://www.closefinch.com/.well-known/security.txt)
