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

# Crear una Smart Template

> Copia en Cursor/Claude/Copilot para generar una integración POST /v1/medical-record-configurations.

Pega este prompt en tu asistente de programación con IA. Ya incluye el contrato, la autenticación y el envoltorio de errores, para que el código generado coincida con la API de producción.

<CodeGroup>
  ```text Prompt theme={null}
  Estás integrando la API pública de Telepatia Synapse.

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

  Solicitud:
  - name [body]: string (opcional, maxLength=200) — Human-readable display name. Defaults to the public id when omitted.
  - description [body]: string (opcional, maxLength=500) — Optional human-readable description of the template.
  - specialty [body]: string (opcional, enum: 219 values) — Medical specialty this template targets, given as the enum key (such as `GENERAL_MEDICINE`) or its camelCase value (such as `generalMedicine`). When set by an institutional API key, the template is distributed as a child copy to every enabled account in the institution that already carries this specialty. Accounts without this specialty are not targets, and a doctor API key never distributes. Optional; omitting it skips distribution.
  - workflow [body]: string (opcional, enum: defaultOutpatient, inpatient, emergencyRoom, reportDictation, historySummary) — Product discriminator for a template. Absent means an ordinary Scribe template.

  `defaultOutpatient`, `inpatient`, and `emergencyRoom` also denote a Scribe
  template; each names the clinical care setting the template is written for.
  `reportDictation` and `historySummary` denote a non-Scribe product.
  - configuration [body]: object (requerido) — Section map keyed by node name (schema + optional prompt strategy).

  Éxito 200:
  - id: string
  - name: string
  - hash: string
  - createdAt: string
  - created: boolean

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

  Genera código en el lenguaje del archivo actual que:
  1. Lea SYNAPSE_API_KEY desde el entorno (no lo escribas de forma fija).
  2. Llame al endpoint con solicitud y respuesta tipadas.
  3. Asigne el envoltorio de errores a excepciones tipadas por código de estado.
  4. Agregue una prueba de flujo exitoso usando el token Bearer.
  ```

  ```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>
