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
Request body
titlestringRequiredA short name for the rule, 1 to 200 characters.
slugstringThe 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.instructionsstringRequiredThe rule in plain language, 1 to 4,000 characters. The model reads it together with the project context and the content of the submission.
examplesobjectSample texts that sharpen the rule. An object with the lists
violatingandcompliant.violatingUp to 20 texts that break the rule, each up to 500 characters. The first 5 are shown to the model.
compliantUp to 20 texts that follow the rule, each up to 500 characters. The first 5 are shown to the model.
enabledbooleanWhether the guideline is evaluated. A disabled guideline scores 0 on the templates that enable it. Default true.
Returns
The new guideline, with status 201.
- 201 CreatedA guideline object
Errors
- 403
plan_limitThe organisation's plan includes no guidelines, or the project already has as many as the plan allows.
- 409
slug_takenThe project already has a guideline with this slug.
- 422
validation_errortitleorinstructionsis missing, empty or too long,slugis 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.