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

# Quickstart

> From keys to your first recorded note

## Set up (once, via the Scribe API)

Do this once per doctor through the [Scribe API (institutional)](https://docs.telepatia.ai/scribe-api-institutional/institutional/create-a-doctor-account),
with your institutional API key. Don't have one? Ask your Telepatia contact.

<Steps>
  <Step title="Register the doctor — save both keys">
    [Create a doctor account](https://docs.telepatia.ai/scribe-api-institutional/institutional/create-a-doctor-account). The response returns two keys, shown once: `publishableApiKey` (`pk_…`) goes on the page; `apiKey` (`sk_…`) is the secret — backend only, never the browser.
  </Step>

  <Step title="Create a smart template — save its id">
    [Create a smart template](https://docs.telepatia.ai/scribe-api-institutional/medical-record-configurations/create-a-smart-template). Save the returned `mrc_…` id; you pass it to `init()`.
  </Step>

  <Step title="Create a webhook">
    [Subscribe](https://docs.telepatia.ai/scribe-api-institutional/webhooks/create-a-webhook-subscription) to `scribe_session.completed`. Save the `signingSecret` to verify the calls. This is how your backend learns a note is ready.
  </Step>
</Steps>

## Add the script

Put the config block before the CDN tag. Serve the page over `https` or
`localhost` — the microphone needs a secure context.

```html theme={null}
<script>
  window.TelepatiaRecorderConfig = {
    apiKey: "pk_…",              // publishable key — never the sk_
    branding: { name: "Your Brand" },
    locale: "en",                // "en" · "es" · "pt"
  };
</script>
<script src="https://cdn.telepatia.ai/telepatia-embed/v0/embed.js"></script>
```

Use a test key while you build (no real data) and your production key to go
live. Same code, no environment flag.

## Open the panel

Call `init()` when the doctor clicks record — it mounts and opens the panel.
Pass the context your app already has (the patient and the doctor's template) so
the note comes back linked to the right consultation.

```js theme={null}
document.getElementById("record").addEventListener("click", () => {
  window.TelepatiaRecorder.init({
    patient:      { name: "Maria Gómez", idCountry: "CO", idType: "CC", idValue: "55544433" },
    template:     { medicalRecordConfigurationId: "mrc_…" },
    consultation: { externalConsultationId: "CONSULT-12345" }, // your encounter id
  });
});
```

<Warning>
  Always pass your own `externalConsultationId` — it's how you fetch the result
  later. Without it Telepatia generates one you can't see. And use `init()` to
  open: `show()` only expands a panel that's already mounted.
</Warning>

## Get the result

Your `externalConsultationId` is the Scribe API's `consultationInternalId` —
same value, different name. When the `scribe_session.completed` webhook fires,
fetch the record on your backend with the secret key (`sk_`), never the browser:

* [Look up the session](https://docs.telepatia.ai/scribe-api-institutional/session-scribes/look-up-scribe-session) — `GET /v1/scribe-sessions/{consultationInternalId}`
* [List the record documents](https://docs.telepatia.ai/scribe-api-institutional/medical-record-documents/list-medical-record-documents) — `GET /v1/scribe-sessions/{consultationInternalId}/medical-record-documents`

The full record schema and error format live in the **Scribe API** product in
this Hub.
