> ## 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.

# Create a Smart Template

> Copy into Cursor/Claude/Copilot to scaffold a POST /v1/medical-record-configurations integration.

Drop this prompt into your AI coding assistant. It already includes the contract, auth, and error envelope so the generated code matches the production API.

<CodeGroup>
  ```text Prompt theme={null}
  You are integrating Telepatia Synapse Public API.

  Endpoint: POST /v1/medical-record-configurations
  Base URL: https://scribe-api.telepatia.ai
  Auth: Authorization: Bearer ${SYNAPSE_API_KEY}

  Request:
  - name [body]: string (optional, maxLength=200) — Human-readable display name. Defaults to the public id when omitted.
  - description [body]: string (optional, maxLength=500) — Optional human-readable description of the template.
  - specialty [body]: string (optional, enum: 219 values) — Medical specialty this template targets (key such as `GENERAL_MEDICINE` or value such as `generalMedicine`). When set by an institutional API key, the template is distributed as a child copy to every account of that specialty in the institution. Optional; omitting it skips distribution.
  - configuration [body]: object (required) — Section map keyed by node name (schema + optional prompt strategy).

  Success 200:
  - id: string
  - name: string
  - hash: string
  - createdAt: string
  - created: boolean

  Errors (envelope: { error: { type, code, message, param? } }):
  - 400: parameter_missing, parameter_invalid, account_invalid
  - 401: authentication_required
  - 409: resource_conflict
  - 503: service_unavailable

  Generate code in the language of the current file that:
  1. Reads SYNAPSE_API_KEY from env (do not hardcode it).
  2. Calls the endpoint with typed request and response.
  3. Maps the error envelope to typed exceptions per status code.
  4. Adds one happy-path test using the Bearer token.
  ```

  ```bash curl theme={null}
  curl -X POST https://scribe-api.telepatia.ai/v1/medical-record-configurations \
    -H "Authorization: Bearer $SYNAPSE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "configuration": {
      "chiefComplaint": {
        "instructionSet": {
          "telepatiaPromptId": "CHIEF_COMPLAINT"
        },
        "schema": {
          "instructions": "Patient's chief complaint.",
          "type": "string"
        }
      },
      "vitals": {
        "instructionSet": {
          "telepatiaPromptId": "VITAL_SIGNS"
        },
        "schema": {
          "instructions": "Vital signs.",
          "properties": {
            "heartRate": {
              "instructions": "Heart rate in bpm.",
              "type": "integer"
            }
          },
          "type": "object"
        }
      }
    },
    "name": "Cardiology intake"
  }'
  ```
</CodeGroup>
