Template API Overview
Templates are reusable notebook configurations that define analysis workflows. Use the Template API to list, retrieve, create, and manage notebook templates programmatically.
Key Concepts
What Are Templates?
Templates are pre-configured notebook definitions containing:
- Blocks: Filters, calculators, insights, and other analysis components
- MCL Text: The configuration text that defines the notebook structure
- Metadata: Name, description, category, and process context
When you create a notebook from a template, all blocks and configurations are automatically applied.
Template Types
| Type | Scope | Can Create via API? | Can Delete via API? |
|---|---|---|---|
| Global | All tenants | No | No |
| Tenant-Specific | Single tenant | Yes | Yes |
Global templates are system-wide and managed through the admin interface. Tenant-specific templates can be created and managed via this API.
Template Categories
Templates are organized into categories:
| Category | Description |
|---|---|
Templates |
Standard analysis templates |
Custom |
User-created custom templates |
BaseKnowledge |
Foundational knowledge templates |
Authentication
All Template API endpoints require a Global API Key. Tenant API keys cannot access template operations.
curl -H "Authorization: Bearer YOUR_GLOBAL_API_KEY" \
https://your-mindzie-instance.com/api/templates
If you use a non-global API key, you'll receive:
{
"error": "This endpoint requires a Global API key.",
"hint": "Global API keys can be created at /admin/global-api-keys"
}
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/templates |
List all global templates |
| GET | /api/templates/tenant/{tenantId} |
List templates for a tenant (global + tenant-specific) |
| GET | /api/templates/category/{category} |
List templates by category |
| GET | /api/templates/{templateId} |
Get template details with MCL text |
| GET | /api/templates/{templateId}/thumbnail |
Get template thumbnail image |
| POST | /api/templates/tenant/{tenantId} |
Create a tenant-specific template |
| PUT | /api/templates/{templateId} |
Update a template |
| DELETE | /api/templates/{templateId} |
Delete a template |
Quick Start
List All Templates for a Tenant
curl -X GET "https://your-mindzie-instance.com/api/templates/tenant/12345678-1234-1234-1234-123456789012" \
-H "Authorization: Bearer YOUR_GLOBAL_API_KEY"
Get Template Details
curl -X GET "https://your-mindzie-instance.com/api/templates/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \
-H "Authorization: Bearer YOUR_GLOBAL_API_KEY"
Create a Notebook from Template
Use the Notebook API to create a notebook from a template:
curl -X POST "https://your-mindzie-instance.com/api/{tenantId}/{projectId}/notebook/investigation/{investigationId}/from-template" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"name": "My Analysis"
}'
Response Structure
Template List Response
{
"templates": [
{
"templateId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"name": "Process Discovery",
"description": "Standard process discovery workflow",
"category": "Templates",
"processName": "Order to Cash",
"tenantId": null,
"isGlobal": true,
"hasThumbnail": true,
"autoAddedDefaultSortOrder": 100,
"dateModified": "2024-01-15T10:30:00Z"
}
],
"totalCount": 1
}
Template Detail Response
{
"templateId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"name": "Process Discovery",
"description": "Standard process discovery workflow",
"category": "Templates",
"processName": "Order to Cash",
"mclText": "// MCL configuration text here...",
"tenantId": null,
"isGlobal": true,
"hasThumbnail": true,
"autoAddedDefaultSortOrder": 100,
"originatingNotebookId": null,
"dateCreated": "2024-01-01T00:00:00Z",
"dateModified": "2024-01-15T10:30:00Z",
"createdBy": null,
"createdByName": "System",
"modifiedBy": null,
"modifiedByName": "System"
}
What's Next?
- Template Management - Full CRUD operations for templates
- Notebook API - Create notebooks from templates