Templates API Reference
Templates API Reference
Engagement templates allow tenants to save reusable engagement configurations. The platform ships with five system templates (brand_digital_presence, business_transformation, go_to_market, product_strategy, research_deep_dive), and tenants can create their own.
Base URL: /api/templates
Authentication: All endpoints require authentication (cookie session or Bearer API key).
List Templates
GET /api/templatesReturns all templates visible to the authenticated tenant. This includes system templates (isSystem: true, tenantId: null) and any templates created by the tenant.
Response
{
"templates": [
{
"id": "clxyz123abc",
"name": "Brand Digital Presence",
"slug": "brand_digital_presence",
"description": "Comprehensive brand audit and digital presence strategy",
"brief": "Analyze the client's current brand positioning...",
"budget": 5.0,
"tasks": [
{
"id": "brand_audit",
"name": "Brand Audit",
"agent": "research_intelligence_analyst",
"description": "..."
}
],
"options": {},
"isSystem": true,
"tenantId": null,
"createdAt": "2025-01-15T10:30:00.000Z"
}
]
}Example
curl -X GET https://app.groundtruth.ai/api/templates \
-H "Authorization: Bearer gt_live_abc123..."Create Template
POST /api/templatesCreates a new tenant-specific template. Requires write access (read_write API key scope or member+ role via session).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template display name |
description | string | Yes | Short description of the template |
brief | string | Yes | Default engagement brief text |
budget | number | No | Default budget in USD (default: 5.0) |
tasks | array | No | Array of task configuration objects |
options | object | No | Additional template options |
The slug is auto-generated from the name field (lowercased, spaces replaced with underscores, special characters removed).
Response
Status: 201 Created
{
"template": {
"id": "clxyz456def",
"name": "Custom Research Template",
"slug": "custom_research_template",
"description": "A tailored research engagement template",
"brief": "Conduct deep research into...",
"budget": 3.5,
"tasks": [],
"options": {},
"isSystem": false,
"tenantId": "clxyz789ghi",
"createdAt": "2025-06-01T14:00:00.000Z"
}
}Example
curl -X POST https://app.groundtruth.ai/api/templates \
-H "Authorization: Bearer gt_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Custom Research Template",
"description": "A tailored research engagement template",
"brief": "Conduct deep research into the competitive landscape...",
"budget": 3.5,
"tasks": [
{
"id": "competitive_analysis",
"name": "Competitive Analysis",
"agent": "research_intelligence_analyst",
"description": "Analyze top 10 competitors in the space"
}
]
}'Get Template
GET /api/templates/:idReturns a single template by ID. The template must be either a system template or belong to the authenticated tenant.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Template ID |
Response
{
"template": {
"id": "clxyz123abc",
"name": "Brand Digital Presence",
"slug": "brand_digital_presence",
"description": "Comprehensive brand audit and digital presence strategy",
"brief": "Analyze the client's current brand positioning...",
"budget": 5.0,
"tasks": [...],
"options": {},
"isSystem": true,
"tenantId": null,
"createdAt": "2025-01-15T10:30:00.000Z"
}
}Example
curl -X GET https://app.groundtruth.ai/api/templates/clxyz123abc \
-H "Authorization: Bearer gt_live_abc123..."Errors
| Status | Description |
|---|---|
| 404 | Template not found or not accessible to the tenant |
Delete Template
DELETE /api/templates/:idDeletes a tenant-specific template. Requires write access. System templates cannot be deleted.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Template ID |
Response
{
"success": true
}Example
curl -X DELETE https://app.groundtruth.ai/api/templates/clxyz456def \
-H "Authorization: Bearer gt_live_abc123..."Errors
| Status | Description |
|---|---|
| 403 | Cannot delete system templates |
| 404 | Template not found or not accessible to the tenant |