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

# Root

> Discovery endpoints and common response shapes.

## GET `/api`

Returns service metadata plus the current caller (if authenticated).

* **Auth** – optional session cookie or API key.
* **Response**

```json theme={null}
{
  "service": "browsary::root",
  "version": "2024-05-01",
  "subject": "public" | { "id": "usr_123", "email": "dev@example.com" }
}
```

Use this endpoint as a health check before attempting privileged operations.

## GET `/:project/api`

Project-scoped equivalent of the root endpoint.

* **Path param** – `project` accepts a slug or UUID; it is resolved via `database.projects.resolve`.
* **Auth** – optional, but the response only includes the project payload when you have the `projects.read` permission for that slug.
* **Response**

```json theme={null}
{
  "service": "browsary::project::proj_123",
  "version": "2024-05-01",
  "project": {
    "id": "proj_123",
    "name": "Marketing Research",
    "slug": "marketing-research",
    "...": "full database row"
  },
  "subject": "public" | { "id": "usr_123", "email": "dev@example.com" }
}
```

## Error shape

Validation errors and rejected permission checks use the same JSON envelope:

```json theme={null}
{
  "status": "error",
  "message": "Human readable explanation"
}
```

Unexpected failures fall back to HTTP 500 with the same structure. Always check the `status` property before trusting other fields.
