Skip to content

Prompt Templates

Manage AI instructions used for generating session summaries. Define how the AI model should process transcripts to produce specific outputs like meeting minutes or clinical notes.

Base path: /api/v1/session-history/summary-prompt-templates

Method Endpoint Description
GET /api/v1/session-history/summary-prompt-templates List Visible Templates
GET /api/v1/session-history/summary-prompt-templates/assigned List Assigned Templates
GET /api/v1/session-history/summary-prompt-templates/{uuid} Get Template Details
POST /api/v1/session-history/summary-prompt-templates Create Prompt Template
PUT /api/v1/session-history/summary-prompt-templates/{uuid} Update Prompt Template
DELETE /api/v1/session-history/summary-prompt-templates/{uuid} Delete Prompt Template
POST /api/v1/session-history/summary-prompt-templates/{uuid}/assign Assign Template to User
DELETE /api/v1/session-history/summary-prompt-templates/{uuid}/unassign Unassign Template
PATCH /api/v1/session-history/summary-prompt-templates/{uuid}/assign Update Assignment

Key Concepts

Template Levels

Templates are scoped to different levels, controlling their visibility and management permissions. See AIPromptConfigLevel for details.

  • USER: Personal templates owned by an individual user.
  • TENANT: Shared templates available to all users within a tenant.
  • APPLICATION: System-wide templates provided by the platform.

Global Assignments

Administrators can configure templates to be automatically available to all users in a tenant without manual assignment.

  • Global (isGlobal): When set to true, the template is implicitly assigned to every user in the tenant who has access to view it.
  • Global Default (isGlobalDefault): When set to true (requires isGlobal=true), the template is automatically assigned to all users in the tenant as a default prompt.

Administrative Permissions

Certain operations require the ai:prompts:admin scope. This permission grants the following capabilities:

  • Create/Edit shared templates: Only admins can manage templates at the TENANT level.
  • Manage Global status: Setting or modifying the global and globalDefault flags.
  • System Prompts: Creating and managing templates with the SYSTEM role.
  • User Management: Viewing, creating, or removing assignments for any specific user in the tenant using the userUuid parameter.
  • Full Visibility: Admins can see all templates in the tenant, including SYSTEM role templates which are hidden from regular users.

Prompt Roles

Each template is assigned a role that determines its function in the summarization pipeline. See PromptType for details.

  • USER: Primary summarization instructions (e.g., "Summarize this meeting").
  • SYSTEM: Behavioral instructions for the AI (e.g., "Act as a professional medical scribe").

Templating Syntax

Prompt templates use Mustache-style placeholders ({{ }}). The following variable is mandatory in all summarization prompts:

Variable Description
{{transcript}} The full session transcript text to be processed.

Mandatory Placeholder

The {{transcript}} placeholder must be present in the promptTemplate field when creating or updating a template. Requests without it will be rejected.


List Visible Templates

GET /api/v1/session-history/summary-prompt-templates

Requires Authentication - Scopes: ai:prompts:read

Retrieve a paginated list of all prompt templates visible to the current user. This includes the user's own templates, tenant-level templates, and application-level templates.

Query Parameters
Parameter Type Required Default Description
page integer No 0 Page number (0-based).
size integer No 20 Number of items per page.
assigned boolean No - Filter by assignment status.
level string No - Filter by AIPromptConfigLevel.
promptRole string No - Filter by PromptType.
userUuid string (UUID) No - Admin only: View assignments for a specific user.
SessionHistoryAIPromptConfigPageDTO
Field Type Nullable Description
contents SessionHistoryAIPromptConfigDTO[] No List of prompt templates.
size integer No Number of items in the current page.
totalElements long No Total number of elements available.
Status Description
200 OK Templates retrieved successfully.
401 Unauthorized Missing or invalid authentication.

List Assigned Templates

GET /api/v1/session-history/summary-prompt-templates/assigned

Requires Authentication - Scopes: ai:prompts:read

Retrieve a list of templates currently assigned to the user (either explicitly or via global assignment).

Query Parameters
Parameter Type Required Default Description
userUuid string (UUID) No - Admin only: List assignments for another user.
page integer No 0 Page number (0-based).
size integer No 20 Page size.

Response: 200 OK - SessionHistoryAIPromptConfigPageDTO


Get Template Details

GET /api/v1/session-history/summary-prompt-templates/{uuid}

Requires Authentication - Scopes: ai:prompts:read

Retrieve full details of a specific prompt template, including its latest content.

Path Parameters
Parameter Type Required Description
uuid string (UUID) Yes The template's unique identifier.

Response: 200 OK - SessionHistoryAIPromptConfigDTO


Create Prompt Template

POST /api/v1/session-history/summary-prompt-templates

Requires Authentication - Scopes: ai:prompts:write

Create a new prompt template. By default, regular users create USER level templates with the USER role.

CreatePromptTemplateRequest
Field Type Required Description
name string Yes Display name (max 100 chars).
description string Yes Description of the template's purpose (max 256 chars).
promptTemplate string Yes The prompt content. Must include {{transcript}}.
promptRole string No PromptType. Defaults to USER.
level string No AIPromptConfigLevel. Defaults to USER.
assign boolean No If true, assigns to the creator (default: false).
assignAsDefault boolean No If true, sets as the user's default (default: true).
global boolean No Admin only: If true, implicitly assigned to all users.
globalDefault boolean No Admin only: If true, the template is assigned to all users in the tenant as a default prompt.
CreatePromptTemplateRequest
{
  "name": "Meeting Minutes",
  "description": "Generates structured meeting minutes with action items",
  "promptTemplate": "Summarize this meeting into: Overview, Discussion, and Action Items.\n\nTranscript:\n{{transcript}}",
  "assign": true,
  "assignAsDefault": true
}
Status Description
201 Created Template created successfully.
400 Bad Request Validation failed (e.g., missing {{transcript}}).

Update Prompt Template

PUT /api/v1/session-history/summary-prompt-templates/{uuid}

Requires Authentication - Scopes: ai:prompts:write

Update an existing template. Modifying the promptTemplate content will automatically increment the version number and create a new immutable version record.

UpdatePromptTemplateRequest
Field Type Required Description
name string No Updated display name.
description string No Updated description.
promptTemplate string No New prompt content (creates a new version).
global boolean No Admin only: Update global visibility.
globalDefault boolean No Admin only: If true, the template is assigned to all users in the tenant as a default prompt.

Response: 200 OK - SessionHistoryAIPromptConfigDTO


Delete Prompt Template

DELETE /api/v1/session-history/summary-prompt-templates/{uuid}

Requires Authentication - Scopes: ai:prompts:delete

Mark a template as deleted. Deletion is permanent for the user, although historical summaries using this template version will remain accessible.

Path Parameters
Parameter Type Required Description
uuid string (UUID) Yes The template identifier.

Response: 204 No Content


Assign Template to User

POST /api/v1/session-history/summary-prompt-templates/{uuid}/assign

Requires Authentication - Scopes: ai:prompts:write

Assign a visible template to yourself or another user.

AssignTemplateRequest
Field Type Required Description
isDefault boolean No Whether this should be the user's default template.
userUuid string (UUID) No Admin only: Assign to a specific user.

Response: 204 No Content


Unassign Template

DELETE /api/v1/session-history/summary-prompt-templates/{uuid}/unassign

Requires Authentication - Scopes: ai:prompts:write

Remove a template assignment. Global templates cannot be unassigned.

Query Parameters
Parameter Type Required Description
userUuid string (UUID) No Admin only: Unassign from a specific user.

Response: 204 No Content


Update Assignment

PATCH /api/v1/session-history/summary-prompt-templates/{uuid}/assign

Requires Authentication - Scopes: ai:prompts:write

Update properties of an existing assignment (e.g., toggling the default status).

Request Body (AssignTemplateRequest): Same as Assign Template.

Response: 204 No Content


Data Models

SessionHistoryAIPromptConfigDTO

Field Type Nullable Description
templateUuid string (UUID) No Unique identifier.
userUuid string (UUID) Yes Owner's UUID. null for shared templates.
displayName string No Template name.
description string No Template description.
promptRole string No PromptType.
level string No AIPromptConfigLevel.
currentTemplate string No The latest prompt content.
currentVersionNumber integer No The current version count.
isGlobal boolean No Whether it is implicitly assigned to all users.
assigned boolean No Whether it is assigned to the current user.
isDefault boolean No Whether it is the user's default template.
isGlobalDefault boolean No Whether the template is a default prompt assigned to all users in the tenant.
editable boolean No Whether the current user can modify this template.
SessionHistoryAIPromptConfigDTO
{
  "templateUuid": "550e8400-e29b-41d4-a716-446655440000",
  "userUuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "displayName": "Meeting Summary",
  "description": "Summarizes meeting transcripts with action items",
  "promptRole": "USER",
  "level": "USER",
  "currentTemplate": "Summarize the following transcript: {{transcript}}",
  "currentVersionNumber": 3,
  "isGlobal": false,
  "assigned": true,
  "isDefault": true,
  "isGlobalDefault": false,
  "editable": true
}

Enums

AIPromptConfigLevel

Defines the scope and ownership level of a template.

Value Description
USER Owned by a specific user.
TENANT Shared within a tenant.
APPLICATION System-wide template.

PromptType

Defines the functional role of the prompt content.

Value Description
USER User-facing summarization prompt.
SYSTEM Administrative behavioral instructions.