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

# Quickstart

> Make your first request against the Everbility Public API.

## 1. Get an API key

Everbility API keys are enabled per organisation.

Ask an organisation admin to enable API keys for your organisation. They can email [support@everbility.com](mailto:support@everbility.com) to enable API keys and/or create a test account.

* Organisation admins can create both organisation API keys and personal user API keys from **User profile > API Keys**.
* When API keys are enabled for the organisation, members can create personal user API keys from **User profile > API Keys**.

Use an organisation key for organisation-scoped clients and templates. Use a user key for personal-scoped clients and templates.

## 2. Check your key

Use the API key directly as a bearer token. There is no JWT exchange step.

```bash theme={null}
curl -s \
  -H "Authorization: Bearer <api_key>" \
  https://api.everbility.com/v1/public/me
```

Example response:

```json theme={null}
{
  "principal_type": "organization",
  "created_by_user_id": "user_123"
}
```

## 3. Search for a client

```bash theme={null}
curl -s \
  -H "Authorization: Bearer <api_key>" \
  "https://api.everbility.com/v1/public/clients/search?q=alex"
```

This returns clients that are visible to the key you used.

## 4. List reports for a client

```bash theme={null}
curl -s \
  -H "Authorization: Bearer <api_key>" \
  "https://api.everbility.com/v1/public/clients/864/documents"
```

Each document in v1 is a report.

## 5. Fetch a rendered report

```bash theme={null}
curl -s \
  -H "Authorization: Bearer <api_key>" \
  "https://api.everbility.com/v1/public/clients/864/documents/<report_id>?format=markdown"
```

Use `format=markdown` or `format=html`.

## 6. Push context back into Everbility

Create a Markdown note:

```bash theme={null}
curl -s \
  -X POST \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"title":"Case summary","markdown":"Patient tolerated session well."}' \
  "https://api.everbility.com/v1/public/clients/864/notes"
```

Upload a PDF or large audio file when you need Everbility to process the file asynchronously.

## 7. Generate a report

Start the job:

```bash theme={null}
curl -s \
  -X POST \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"template_id":"<template_id>","note_ids":["<note_id>"]}' \
  "https://api.everbility.com/v1/public/clients/864/reports/generate"
```

Then poll the returned `job_id` until it completes:

```bash theme={null}
curl -s \
  -H "Authorization: Bearer <api_key>" \
  "https://api.everbility.com/v1/public/jobs/<job_id>"
```

Templates without prompt nodes still complete successfully and save the
template content directly. Templates with prompt nodes generate those sections
from the supplied notes before the report is saved.

When the job is `completed`, read `result.report_id` and fetch the saved report from:

```bash theme={null}
curl -s \
  -H "Authorization: Bearer <api_key>" \
  "https://api.everbility.com/v1/public/clients/864/documents/<report_id>?format=markdown"
```
