> ## Documentation Index
> Fetch the complete documentation index at: https://docs.montereyfinancial.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Exchange an API key for an access token and list your first Monterey accounts.

You exchange your long-lived API key for a short-lived token, then list your Monterey accounts.

## Prerequisites

* An API key scoped to at least one organization
* The `accounts:read` API permission on that key
* The key prefix shown in the client portal
* `curl` and `jq`

## 1. Mint an access token

```bash theme={null}
set -o pipefail
ACCESS_TOKEN=$(curl --fail-with-body -sS -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "mfs_AbCd1234",
    "client_secret": "mk_your_key_here"
  }' \
  https://api.montereyfinancial.app/v1/oauth/token | jq -er .access_token)
```

The access token expires after 3600 seconds. Keep the API key in your secret store and re-run the exchange before expiry.

## 2. List accounts

```bash theme={null}
curl -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.montereyfinancial.app/v1/accounts?limit=100"
```

A successful response includes `items` and pagination metadata:

```json theme={null}
{
  "items": [
    {
      "id": "01J...",
      "organization_id": "01K...",
      "external_id": "00012345",
      "external_contract_id": "YOUR-CONTRACT-12345",
      "borrowers": [
        {
          "party_id": "01J...",
          "display_name": "Jane Smith",
          "role": "primary",
          "is_primary": true
        }
      ]
    }
  ],
  "page": {
    "next_cursor": null,
    "has_more": false,
    "limit": 100
  }
}
```

If `next_cursor` is not null, pass it as the next request's `cursor` parameter.

## What to read next

> **[Authentication](https://docs.montereyfinancial.com/api-reference/authentication.md)**
>
> Token exchange, expiry, API-key rotation, and authorization errors.

> **[Conventions](https://docs.montereyfinancial.com/api-reference/conventions.md)**
>
> Rate limits, pagination, dates, money, and shared errors.

> **[Domain concepts](https://docs.montereyfinancial.com/api-reference/domain-concepts.md)**
>
> Organizations, people, borrower roles, accounts, and transactions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.