BotsRated

Help › How-tos

API: /v1/policy and /v1/policy/*

purpose

Private buyer policy. GET /v1/policy/packs is free and needs no auth (starter packs none | warn | careful-buyer | strict; default none). GET/PUT/DELETE /v1/policy and POST /v1/policy/check[/batch] need a bearer (paid alerts/data plan token brs_ or org key brk_). These checks are not a BotsRated rating.

call

curl -sS 'https://botsrated.com/v1/policy/packs'

# Auth required (live 401 without a token):
curl -sS 'https://botsrated.com/v1/policy'
curl -sS -X POST 'https://botsrated.com/v1/policy/check' \
  -H 'Content-Type: application/json' -d '{}'

sample_response

source: live code. GET /v1/policy/packs 200 (free). Without a token, GET /v1/policy and POST /v1/policy/check answer 401 paid_plan_token_required. GET /v1/policy 200: policy, policy_version, updated_at, org_id, note (404 no_policy_saved if none). PUT /v1/policy 200: policy_version, updated_at, warnings, policy. POST /v1/policy/check 200: decision, decided_by "your_policy", policy_version, not_a_botsrated_rating true, signed false, host, reasons, facts_as_of, data_stale, fail_mode, evaluated_at, note. fetched: live production, 24 Nov 2026 (counts redacted) trimmed: true

{
  "packs_trim": {
    "service": "BotsRated",
    "private": true,
    "decided_by": "your_policy",
    "not_a_botsrated_rating": true,
    "signed": false,
    "default_pack": "none",
    "note": "Starter rules for your own private policy. Nothing applies until you save one with your token (PUT /v1/policy). You choose fail_mode. Not a judgement of any seller; your client enforces.",
    "packs_0": {
      "id": "none",
      "label": "none: only the two always-on checks",
      "rules": [
        {
          "id": "preset:resource_url_mismatch",
          "when": {
            "resource_url_mismatch": true
          },
          "then": "block"
        },
        {
          "id": "preset:network_or_asset_not",
          "when": {
            "network_or_asset_not": true
          },
          "then": "block"
        }
      ],
      "apply": {
        "method": "PUT",
        "url": "https://botsrated.com/v1/policy",
        "auth": "Authorization: Bearer <brs_ plan key or brk_ org key with policy-write>",
        "body": {
          "preset": "none",
          "fail_mode": "<open|closed>",
          "rules": [],
          "allow": {
            "hosts": [],
            "payTos": []
          },
          "deny": {
            "hosts": [],
            "payTos": []
          }
        }
      }
    }
  },
  "policy_get_or_check": {
    "error": "paid_plan_token_required",
    "message": "Need an active paid alerts/data plan bearer (brs_…) or an org key (brk_…).",
    "hint": "See GET /v1/plans. Org keys use brk_ prefix."
  }
}

errors

codewhenfix
paid_plan_token_required (live 401)No brs_ or brk_ bearer.This is not a free-key (brf_) route. A person must have an active paid plan or org key.

notes