Skip to content

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

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.

The template objectJSON
{
  "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.

idstring

Id of the template: tpl_ plus 22 base62 characters. API paths and requests use slug instead.

slugstring

The name used in requests, for example listing. Unique in the project.

namestring

Display name.

descriptionstring or null

What the template is for, or null. The models read it as the content's context when context is empty.

statusenum

draft: 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 ofdraftactivearchived

built_inboolean

True for the basic check that every project has. It is read-only and does not count towards the plan's template limit.

versioninteger or null

Number of the published version, or null for a template that was never published. The configuration properties are absent in that case.

contextstring or null

What this content is and where it comes from, written for the models, up to 2,000 characters. Null when not set.

fieldsarray of maps

The fields of the form. Each has key, name, type (text, image, number, boolean, enum, url or json), required, validation and triggers, and optionally description and policies, the policies that run on this field when they are restricted. A template can also declare audio and video fields; a value sent in one is refused while those types are in development.

policiesarray of maps

The policies the template runs. Each has key and mode (trigger or observe), and optionally threshold, effect (flag or review), weight, instructions and options.

triggersarray of maps

The template-level triggers. Each has policy, effect (flag or review) and optionally threshold. A policy in trigger mode that has no explicit trigger anywhere gets an implicit flag trigger at its threshold.

rulesarray of maps

The content rules, in order. Each has id, name, enabled, conditions and action (allow, review or reject). The first enabled rule whose conditions all hold decides the recommendation.

severityobject

The thresholds of severity triage, which decides the recommendation when no content rule matches.

reviewnumber

Severity score from which the recommendation is review. Default 0.40.

0 to 1.

rejectnumber

Severity score from which the recommendation is reject. Default 0.80.

0 to 1.

ai_instructionsstring or null

Plain-language instructions evaluated across all fields together, up to 8,000 characters, and scored as the policy instructions. Null when not set.

created_attimestamp

When the template was created, ISO 8601 in UTC.

updated_attimestamp

When the template last changed, ISO 8601 in UTC.

settingsobject

Template settings, any of language_hint, store, cache, review_sla_minutes, safety_pass and models. An empty object when none is set.

Something missing or unclear on this page? Write to support@useinfrared.com.