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

# API Introduction

> Base URL, authentication, and where to start with the Prophia REST API

The Prophia REST API is a JSON API over your portfolio data — the same accounts, properties, buildings, leases, documents, and tags you see in the app.

## Base URL

```
https://api.prophia.com/rest/v2
```

Every resource is scoped to an account:

```
GET /rest/v2/accounts/{accountId}/properties
GET /rest/v2/accounts/{accountId}/leases/{leaseId}
```

## Your first call

**1. Get an API key**

See [Authentication](https://docs.prophia.com/developers/authentication.md) for key types and how to obtain one. If you plan to write as well as read, [write access](https://docs.prophia.com/developers/write-access.md) is a separate entitlement.

**2. Find your account**

```bash theme={null}
curl https://api.prophia.com/rest/v2/accounts \
  -H "X-API-Key: <your-api-key>"
```

The response lists the accounts your key can access — grab the `id`.

**3. List your properties**

```bash theme={null}
curl "https://api.prophia.com/rest/v2/accounts/{accountId}/properties" \
  -H "X-API-Key: <your-api-key>"
```

Every endpoint page in this reference has a **Try it** playground — paste your key into the auth field and call the live API from your browser.

## Learn the concepts

The endpoint pages document each operation; these pages explain the ideas that span them.

**Data concepts** — what the objects mean

> [card] [Data model](https://docs.prophia.com/api-reference/v2/concepts/data-model.md)
>
> How accounts, properties, buildings, spaces, leases, documents, and tags relate — with the diagram.

> [card] [Leases](https://docs.prophia.com/api-reference/v2/concepts/leases.md)
>
> Status fields, lease type, subleases, and the spaces a lease occupies.

> [card] [Documents](https://docs.prophia.com/api-reference/v2/concepts/documents.md)
>
> Upload, the `documentStatus` lifecycle, categories, and change detection.

> [card] [Tags](https://docs.prophia.com/api-reference/v2/concepts/tags-and-values.md)
>
> Extracted lease terms — how they're structured, plus a reference to every term Prophia captures.

> [card] [Spaces and encumbrances](https://docs.prophia.com/api-reference/v2/concepts/spaces-and-encumbrances.md)
>
> Building spaces, applicable spaces, and which spaces are burdened by options.

> [card] [Understanding onboarding](https://docs.prophia.com/api-reference/v2/concepts/onboarding.md)
>
> Why a building's data is incomplete until Prophia finishes curating it — and how to tell.

**API mechanics** — how requests behave

> [card] [Includes](https://docs.prophia.com/api-reference/v2/concepts/includes.md)
>
> Embed related resources in one request — and the rules that make it predictable.

> [card] [Pagination, sorting, and filtering](https://docs.prophia.com/api-reference/v2/concepts/pagination-and-filtering.md)
>
> The list envelope, paging rules, and per-resource sort and filter fields.

> [card] [Errors and permissions](https://docs.prophia.com/api-reference/v2/concepts/errors-and-permissions.md)
>
> Status codes, the capabilities model, and why 404 sometimes means 403.

## Errors

Requests fail with conventional status codes — `400` for malformed requests, `401` for key problems, `403`/`404` for permission and visibility issues. See [Errors and permissions](https://docs.prophia.com/api-reference/v2/concepts/errors-and-permissions.md) for the full semantics, including why a 404 can mean "no access".


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