Skip to content

List policies

GET/v1/policiesKey scope read

Lists every policy the project can score: the pre-built catalog, including the policies that are in development and marked supported: false, followed by one entry per guideline and per wordlist. The list is not paginated.

Needs a key with the read scope. Authentication

curl https://api.useinfrared.com/v1/policies \
  -H "Authorization: Bearer $INFRARED_KEY"
200 OKResponse
{
  "object": "list",
  "data": [
    {
      "object": "policy",
      "key": "toxicity",
      "name": "Toxicity",
      "description": "Insults, harassment, threats and demeaning language aimed at a person or group.",
      "group": "toxicity_hate",
      "modalities": ["text"],
      "engine": "classifier",
      "tier": "basic",
      "check_weight": 1,
      "weight": 1,
      "default_threshold": 0.7,
      "default_mode": "trigger",
      "labels": ["insult", "harassment", "threat"],
      "experimental": false,
      "supported": true
    },
    {
      "object": "policy",
      "key": "hate_speech",
      "name": "Hate speech",
      "description": "Attacks or slurs based on ethnicity, nationality, religion, gender, sexuality, disability or similar.",
      "group": "toxicity_hate",
      "modalities": ["text"],
      "engine": "classifier",
      "tier": "basic",
      "check_weight": 0,
      "weight": 1,
      "default_threshold": 0.7,
      "default_mode": "trigger",
      "labels": ["slur", "dehumanizing", "incitement"],
      "experimental": false,
      "supported": true
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Returns

A list object that holds every policy. Catalog entries carry all properties. Guideline and wordlist entries carry object, key, name, group, engine, tier, modalities and enabled, plus mode for wordlists. has_more is always false.

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.