Skip to content

Create a guideline

POST/v1/guidelinesKey scope write

Creates a guideline. It scores nothing until a template enables its policy, guideline/<slug>, which is done in the template editor of the dashboard.

Needs a key with the write scope. Authentication

curl https://api.useinfrared.com/v1/guidelines \
  -H "Authorization: Bearer $INFRARED_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "No replica goods",
    "instructions": "Listings must not offer replicas, counterfeits or unauthorised copies of branded goods. Flag wording such as replica, 1:1 copy or mirror quality."
  }'
201 CreatedResponse
{
  "object": "guideline",
  "id": "gl_1LEog5dec7KKCgP7InZcWk",
  "project_id": "prj_0TBAgHGtdMketrbltGFHuk",
  "slug": "no-replica-goods",
  "policy": "guideline/no-replica-goods",
  "title": "No replica goods",
  "instructions": "Listings must not offer replicas, counterfeits or unauthorised copies of branded goods. Flag wording such as replica, 1:1 copy or mirror quality.",
  "examples": {
    "compliant": [],
    "violating": []
  },
  "enabled": true,
  "position": 1,
  "created_at": "2026-10-08T09:29:23.856Z",
  "updated_at": "2026-10-08T09:29:23.856Z"
}

Request body

titlestringRequired

A short name for the rule, 1 to 200 characters.

slugstring

The slug used in the policy key guideline/<slug>: 2 to 80 lowercase letters, digits and single hyphens. Default: derived from the title, with a number added when it is taken. It cannot be changed later.

instructionsstringRequired

The rule in plain language, 1 to 4,000 characters. The model reads it together with the project context and the content of the submission.

examplesobject

Sample texts that sharpen the rule. An object with the lists violating and compliant.

violating

Up to 20 texts that break the rule, each up to 500 characters. The first 5 are shown to the model.

compliant

Up to 20 texts that follow the rule, each up to 500 characters. The first 5 are shown to the model.

enabledboolean

Whether the guideline is evaluated. A disabled guideline scores 0 on the templates that enable it. Default true.

Returns

The new guideline, with status 201.

Errors

403
plan_limit

The organisation's plan includes no guidelines, or the project already has as many as the plan allows.

409
slug_taken

The project already has a guideline with this slug.

422
validation_error

title or instructions is missing, empty or too long, slug is not a valid slug, or the body has an unknown key.

Every endpoint can also answer the errors any request can meet: a missing key, a rate limit, a malformed body. Errors

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