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

# API Overview

> How PlanSync APIs are organized and how customer integrations should use them.

# API Overview

PlanSync API surface is organized into three layers:

* `/api/auth/*` for Better Auth session flows
* `/api/v1/*` for product APIs
* `/api/stripe/*` for billing-related operations

## Base URL and proxy behavior

In production, use the API domain base URL (for example `https://api.plansync.dev`).\
In local development, the web app usually proxies `/api/*` through the frontend host.

The OpenAPI source of truth for this documentation is:

* `openapi/openapi.yaml`

## Response patterns

Most endpoints return JSON.

Common behaviors:

* `200/201` success payloads
* `400` validation/body shape issues
* `401` unauthenticated
* `403` authenticated but not allowed (including email verification requirements)
* `402` plan entitlement required
* `404` resource not found

## Important integration note

Prefer **project API keys** (`x-api-key`) for integrations and the docs playground.

Session cookies still power the signed-in web app. Use cookies when calling from a browser session; use API keys for server-to-server or playground testing.

## Common endpoint families

* Workspace/project management
* Files, uploads, viewer state/collaboration
* Issues, RFIs, punch lists, field reports
* Takeoff, materials, schedule
* Proposals and O\&M modules
* Public token routes (proposal and occupant portals)

Continue to [Authentication](authentication) before implementing any integration.

## Example: health check

```bash theme={null}
curl -X GET "https://api.plansync.dev/api/v1/health"
```

```json theme={null}
{
  "ok": true
}
```
