---
title: "Get a moderation policy"
method: GET
path: "/guardrails/policies/moderation/{id}"
tags: ["Guardrail Policies"]
---

# Get a moderation policy

`GET /guardrails/policies/moderation/{id}`

## Request

- Base URL: `https://openrouter.ai/api/v1`
- URL: `https://openrouter.ai/api/v1/guardrails/policies/moderation/{id}`
- Auth: HTTP bearer

Get a moderation policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.

## Path parameters

- `id` string, uuid, required: Policy ID

## Query parameters

- `workspace_id` string, uuid: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.

## Response `200`

moderation policy details

- ModerationGuardrailPolicyDetailResponse
  - `data` ModerationGuardrailPolicyDetail, required
    - `api_key_hashes` string[], required: API key hashes
    - `config` GuardrailModerationPolicyConfig, required
      - `armor` object, nullable
        - `classifier_context` ArmorContext: The Armor context: Claude Code's `classifier_context` (v1), with `auto_mode.{hard_deny,soft_deny,allow}` rules as strings or `{ id, instructions, threshold? }` objects and `auto_mode.environment` entries as `"Name: value"` strings or `{ name, value }` objects. `threshold` applies when Armor evaluates; when the provider evaluates natively (Anthropic dangerous-tool-use beta) rules are judged at the provider's own boundary.
          - `auto_mode` ArmorAutoMode
            - `allow` union[]
              - …
            - `environment` union[]
              - …
            - `hard_deny` union[]
              - …
            - `soft_deny` union[]
              - …
          - `v` 1, required
        - `mode` 'enforce' | 'audit': `enforce` withholds blocked calls; `audit` evaluates and reports the same verdicts without withholding any calls, regardless of `on_error`. Default `enforce`.
        - `on_error` 'log' | 'block': When the classifier cannot answer (timeout, upstream error, context too long) the call is reported `unavailable`; `block` rejects it and `log` releases it. Default `block`.
        - `use_cc_style_default_rules` boolean: Prepend Claude Code's built-in auto-mode rule set (1 hard-deny, 72 soft-deny, 17 allow, 21 environment slots) ahead of every configured rule. Defaults to true on the Anthropic Messages API and false elsewhere.
      - `broadcast_model_armor_flagged_requests` boolean, nullable
      - `content_filter_blocks_requests` boolean
      - `content_filter_builtins` object[], nullable
        - `action` 'redact' | 'block' | 'flag', required
        - `label` string
        - `scan_scope` 'user_only' | 'all_messages'
        - `slug` 'email' | 'phone' | 'ssn' | 'credit-card' | 'ip-address' | 'secrets' | 'person-name' | 'address' | 'regex-prompt-injection', required
      - `content_filter_patterns` string[], nullable
      - `content_filters` object[], nullable
        - `action` 'redact' | 'block' | 'flag', required
        - `label` string, nullable
        - `pattern` string, required
      - `enable_model_armor_injection_protection` boolean, nullable
      - `lakera_injection_protection_mode` 'block' | 'flag' | 'null', nullable
      - `model_armor_injection_confidence_level` 'low' | 'medium' | 'high'
      - `model_armor_injection_protection_mode` 'block' | 'flag' | 'null', nullable
      - `pii_filters` object[], nullable
        - `action` 'redact' | 'block' | 'flag', required
        - `entity_type` string, required
        - `score_threshold` number
      - `platform_image_moderated_providers` string[], nullable
      - `platform_moderated_providers` string[], nullable
    - `id` string, uuid, required: Policy ID
    - `is_account_policy` boolean: Whether this is an account-owned policy rather than a workspace policy
    - `is_workspace_default` boolean
    - `member_ids` string[], required: Organization member user IDs
    - `name` string, required: Policy name
    - `opted_out_api_key_hashes` string[], required: API key hashes
    - `opted_out_member_ids` string[]: Organization member user IDs
    - `overridden_api_key_hashes` string[], required: API keys that have a different policy of this type assigned directly
    - `overridden_member_ids` string[]: Members that have a different policy of this type assigned directly
    - `policy_type` 'moderation', required
    - `reference` 'legacy_mapping' | 'account_default' | 'null', nullable: `legacy_mapping` when the policy is synced from a v1 guardrail, `account_default` when it is an account-wide default, otherwise `null`
    - `replaces_legacy_default` boolean: Whether this workspace copy replaced a v1 workspace default guardrail that still exists; it cannot be deleted
    - `updated_at` string, nullable, required

## Other responses

- `400`: Bad Request - Invalid request parameters or malformed input
- `401`: Unauthorized - Authentication required or invalid credentials
- `403`: Forbidden - Authentication successful but insufficient permissions
- `404`: Not Found - Resource does not exist
- `500`: Internal Server Error - Unexpected server error

## Changes

- **2026-11-11** `5aee117d1dca`: 1 info
  - the `query` request parameter `workspace_id` became optional
- **2026-11-06** `02121928ccaf`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openrouterteam/apis/openrouter-api/changes/guardrails/policies/moderation/:id/get.md)

---

[API](https://skmtc.dev/openrouterteam/apis/openrouter-api.md) - [All operations](https://skmtc.dev/openrouterteam/apis/openrouter-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openrouterteam/apis/openrouter-api/revisions/f797e38f23b4?raw)
