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

# Create Template

> Create a custom note template. Describe the exact structure, sections and style you want in `desc` using plain text or markdown — for example "SOAP note with Subjective, Objective, Assessment, Plan; use bullet points; include a medication table". EkaScribe uses this description as the authoring instruction when generating notes. Pass the returned `template_id` in Create Session (`templates`) or Process Template.


Create a custom note template: just a `title` and a `desc` describing your format in plain text or markdown (sections, bullets, tables, tone). Always pass `section_ids: []`.

```json theme={null}
{
  "title": "Cardiology OPD Note",
  "desc": "## Chief Complaint\n## History\n## Examination (bullets, vitals table)\n## Plan (numbered, with follow-up date)",
  "section_ids": []
}
```

Use the returned `template_id` in [Create Session](/ekascribe/api-reference/sessions/create-session) or [Process Template](/ekascribe/api-reference/sessions/process-template).


## OpenAPI

````yaml POST /voice/api/v1/template
openapi: 3.0.1
info:
  title: EkaScribe Protocol API (MedScribeAlliance v0.1)
  version: '0.1'
  description: >
    Session-based medical voice capture API implementing the MedScribeAlliance
    Protocol v0.1. Discover service capabilities, create a session, stream audio
    chunks, then end the session to trigger asynchronous transcription and
    structured-template extraction.
servers:
  - url: https://api.eka.care
    description: Production server
  - url: https://api.dev.eka.care
    description: Development server
security: []
paths:
  /voice/api/v1/template:
    post:
      tags:
        - templates
      summary: Create Template
      description: >
        Create a custom note template. Describe the exact structure, sections
        and style you want in `desc` using plain text or markdown — for example
        "SOAP note with Subjective, Objective, Assessment, Plan; use bullet
        points; include a medication table". EkaScribe uses this description as
        the authoring instruction when generating notes. Pass the returned
        `template_id` in Create Session (`templates`) or Process Template.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateCreateRequest'
            example:
              title: Cardiology OPD Note
              desc: |
                Generate a cardiology outpatient note with these sections:
                ## Chief Complaint
                ## History of Present Illness
                ## Examination (bullet points, include vitals table)
                ## Assessment
                ## Plan (numbered list with medications and follow-up date)
              section_ids: []
      responses:
        '201':
          description: Template created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateCreateResponse'
              example:
                msg: created successfully
                template_id: tpl_7d1a2b3c4d5e
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - auth: []
components:
  schemas:
    TemplateCreateRequest:
      type: object
      required:
        - title
        - section_ids
      properties:
        title:
          type: string
          description: Display name of the template.
          example: Cardiology OPD Note
        desc:
          type: string
          description: >
            The template instructions in plain text or markdown. Describe the
            sections, ordering, formatting (bullets, tables, headings) and tone
            you want in the generated note. This is what EkaScribe follows when
            generating notes with this template.
        section_ids:
          type: array
          items:
            type: string
          description: >-
            Pass an empty array `[]`. Describe your desired structure in `desc`
            instead.
          example: []
        type:
          type: string
          description: Template type. Use `custom` (default) for your own templates.
          example: custom
    TemplateCreateResponse:
      type: object
      properties:
        msg:
          type: string
          example: created successfully
        template_id:
          type: string
          example: tpl_7d1a2b3c4d5e
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: invalid_audio_format
            message:
              type: string
              description: Human-readable error message.
              example: Audio format 'audio/mp3' is not supported
            details:
              type: object
              additionalProperties: true
              description: Additional error context.
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````