Skip to main content

Templates API

List Templates

GET /api/templates
List templates available to the current user (public + organization + personal). Query Parameters:
ParameterTypeDescription
categorystringFilter by category
searchstringSearch by name/description
typestringFilter by template type
curl -G https://app.thig.ai/api/templates \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "category=product" \
  -d "search=mobile"

Get Template

GET /api/templates/{id}
Returns template details. systemPrompt is replaced with [Protected] for non-superadmin users on system/marketplace templates.
curl https://app.thig.ai/api/templates/tmpl_456 \
  -H "Authorization: Bearer YOUR_API_KEY"

Template Versions

GET /api/templates/{id}/versions
List all versions of a template. Requires org admin.

Restore Template Version

POST /api/templates/{id}/restore
Body: { "versionId": "ver_123" }

Admin Template Management

List (Admin)

GET /api/admin/templates
Query Parameters:
ParameterTypeDescription
templateTypestringpersonal, organization, system, marketplace
categorystringTemplate category
visibilitystringpersonal, organization, public
isActivebooleanActive status
isFeaturedbooleanFeatured status
pricingTierstringPricing tier filter
searchstringSearch query
sortBystringSort field
sortOrderstringasc or desc
limitnumberResults per page
offsetnumberPagination offset

Create Template

POST /api/admin/templates
Body:
FieldTypeRequiredDescription
namestringYesTemplate name
descriptionstringYesDescription
categorystringYesCategory
templateTypestringNopersonal, organization, system, marketplace
systemPromptstringNoAI instructions
initialQuestionstringNoFirst question AI asks
sectionsstring[]NoPRD sections
tagsstring[]NoTags
featuresstring[]NoKey features
visibilitystringNopersonal, organization, public
isActivebooleanNoActive status
isFeaturedbooleanNoFeatured status
pricingTierstringNoPricing tier
curl -X POST https://app.thig.ai/api/admin/templates \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SaaS PRD Template",
    "description": "Optimized for SaaS product requirements",
    "category": "product",
    "sections": ["Problem Statement", "User Personas", "Features", "Success Metrics"],
    "tags": ["saas", "product"],
    "visibility": "organization"
  }'

Update Template

PATCH /api/admin/templates/{id}
Partial update. System/marketplace templates blocked for non-superadmins.

Delete Template

DELETE /api/admin/templates/{id}

Marketplace

Browse Marketplace

GET /api/marketplace-templates
Public endpoint. No authentication required. Query Parameters:
ParameterTypeDescription
categorystringFilter by category
searchstringSearch query
featuredbooleanFeatured only
pricingTierstringTier filter
sortstringSort order
curl -G https://app.thig.ai/api/marketplace-templates \
  -d "category=product" \
  -d "featured=true"

Get Marketplace Template

GET /api/marketplace-templates/{templateId}

Submit Template

POST /api/template-submissions
Submit a community template for marketplace approval.
curl -X POST https://app.thig.ai/api/template-submissions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"templateId": "tmpl_789"}'

List My Submissions

GET /api/template-submissions
View your own template submissions and their approval status.