Templates
A template is the configured form for one kind of content: its fields with validation and triggers, the policies it runs, its content rules, severity thresholds and AI instructions. The API lists, reads and tests templates; they are created, edited and published in the dashboard.
Endpoints
- GET/v1/templatesList templates
- GET/v1/templates/{slug}Retrieve a template
- POST/v1/templates/{slug}/testTest a template
The template object
A template as its published version: the fields of one kind of content, the policies that run on them, and the rules that turn scores into a recommendation.
{
"object": "template",
"id": "tpl_64mYq4nD3NXNfu0gcdaMZa",
"slug": "listing",
"name": "Listing",
"description": null,
"status": "active",
"built_in": false,
"version": 2,
"context": "A public listing on a marketplace: an item, a service, a property or a vehicle for sale or rent, with a price and photos of what is offered. Buyers contact the seller through the platform.",
"fields": [
{
"key": "title",
"name": "Title",
"type": "text",
"required": true,
"triggers": [
{
"effect": "flag",
"policy": "hate_speech"
},
{
"effect": "flag",
"policy": "links_contact"
}
],
"validation": {
"max_length": 120,
"min_length": 5
},
"description": "Short headline naming what is offered."
},
{
"key": "description",
"name": "Description",
"type": "text",
"required": true,
"triggers": [
{
"effect": "flag",
"policy": "profanity"
},
{
"effect": "flag",
"policy": "toxicity"
}
],
"validation": {
"max_length": 5000
},
"description": "What is offered: condition, specifications, terms and details."
},
{
"key": "price",
"name": "Price",
"type": "number",
"required": false,
"triggers": [],
"validation": {
"min": 0
},
"description": "The asking price in the listing's currency."
},
{
"key": "photos",
"name": "Photos",
"type": "image",
"required": false,
"triggers": [
{
"effect": "review",
"policy": "made_with_ai",
"threshold": 0.9
}
],
"validation": {
"max_bytes": 10485760,
"max_items": 10
},
"description": "Photos of what is offered: the item, property, vehicle or premises. Logos, labels and signage with the seller's own details are normal."
}
],
"policies": [
{
"key": "profanity",
"mode": "trigger"
},
{
"key": "hate_speech",
"mode": "trigger"
},
{
"key": "toxicity",
"mode": "trigger"
}
],
"triggers": [
{
"effect": "flag",
"policy": "hate_speech"
},
{
"effect": "flag",
"policy": "toxicity"
},
{
"effect": "flag",
"policy": "violence"
}
],
"rules": [
{
"id": "r1",
"name": "Block banned authors",
"action": "reject",
"enabled": true,
"conditions": [
{
"op": "is_not",
"type": "author_status",
"value": "enabled"
}
]
},
{
"id": "r2",
"name": "Zero tolerance for hate",
"action": "reject",
"enabled": true,
"conditions": [
{
"type": "policy_flagged",
"value": true,
"policy": "hate_speech"
}
]
},
{
"id": "r3",
"name": "Illicit goods",
"action": "reject",
"enabled": true,
"conditions": [
{
"type": "policy_flagged",
"value": true,
"policy": "illicit"
}
]
}
],
"severity": {
"reject": 0.8,
"review": 0.4
},
"ai_instructions": "Check that the title, description, price and photos describe the same offer, that the photos show what is offered rather than unrelated or stock images, and that the price is plausible for what is described. Flag listings that only advertise another website or ask buyers to pay outside the platform.",
"settings": {},
"created_at": "2026-10-08T08:44:31.624Z",
"updated_at": "2026-10-08T09:28:01.454Z"
}Attributes
object"template"Always
template.idstringId of the template:
tpl_plus 22 base62 characters. API paths and requests usesluginstead.slugstringThe name used in requests, for example
listing. Unique in the project.namestringDisplay name.
descriptionstring or nullWhat the template is for, or null. The models read it as the content's context when
contextis empty.statusenumdraft: never published, so it cannot run.active: has a published version.archived: left out of the list by default and refused by moderation requests.One of
draftactivearchivedbuilt_inbooleanTrue for the basic check that every project has. It is read-only and does not count towards the plan's template limit.
versioninteger or nullNumber of the published version, or null for a template that was never published. The configuration properties are absent in that case.
contextstring or nullWhat this content is and where it comes from, written for the models, up to 2,000 characters. Null when not set.
fieldsarray of mapsThe fields of the form. Each has
key,name,type(text,image,number,boolean,enum,urlorjson),required,validationandtriggers, and optionallydescriptionandpolicies, the policies that run on this field when they are restricted. A template can also declareaudioandvideofields; a value sent in one is refused while those types are in development.policiesarray of mapsThe policies the template runs. Each has
keyandmode(triggerorobserve), and optionallythreshold,effect(flagorreview),weight,instructionsandoptions.triggersarray of mapsThe template-level triggers. Each has
policy,effect(flagorreview) and optionallythreshold. A policy in trigger mode that has no explicit trigger anywhere gets an implicitflagtrigger at its threshold.rulesarray of mapsThe content rules, in order. Each has
id,name,enabled,conditionsandaction(allow,revieworreject). The first enabled rule whose conditions all hold decides the recommendation.severityobjectThe thresholds of severity triage, which decides the recommendation when no content rule matches.
reviewnumberSeverity score from which the recommendation is
review. Default 0.40.0 to 1.
rejectnumberSeverity score from which the recommendation is
reject. Default 0.80.0 to 1.
ai_instructionsstring or nullPlain-language instructions evaluated across all fields together, up to 8,000 characters, and scored as the policy
instructions. Null when not set.created_attimestampWhen the template was created, ISO 8601 in UTC.
updated_attimestampWhen the template last changed, ISO 8601 in UTC.
settingsobjectTemplate settings, any of
language_hint,store,cache,review_sla_minutes,safety_passandmodels. An empty object when none is set.
Something missing or unclear on this page? Write to support@useinfrared.com.