---
title: "Validate Blocked Words File"
method: POST
path: "/guardrails/validate_blocked_words_file"
tags: ["guardrails"]
---

# Validate Blocked Words File

`POST /guardrails/validate_blocked_words_file`

Validate a blocked_words YAML file content.

Args:
    request: Dictionary with 'file_content' key containing the YAML string

Returns:
    Dictionary with 'valid' boolean and either 'message'/'errors' depending on result

Example Request:
```json
{
    "file_content": "blocked_words:\n  - keyword: \"test\"\n    action: \"BLOCK\""
}
```

Example Success Response:
```json
{
    "valid": true,
    "message": "Valid YAML file with 2 blocked words"
}
```

Example Error Response:
```json
{
    "valid": false,
    "errors": ["Entry 0: missing 'action' field"]
}
```

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-27** `b694deb1e459` — 2 info
  - api tag `guardrails` added
  - api tag `Guardrails` removed
- **2026-09-26** `cfac079bcc04` — 2 info
  - api tag `Guardrails` added
  - api tag `guardrails` removed
- **2026-09-25** `a4fccd4bf54d` — 2 info
  - api tag `guardrails` added
  - api tag `Guardrails` removed
- **2026-09-21** `6246f8d427b7` — 2 info
  - api tag `Guardrails` added
  - api tag `guardrails` removed
- **2026-09-19** `c357baf422ab` — 2 info
  - api tag `guardrails` added
  - api tag `Guardrails` removed

[Full history](https://skmtc.dev/flock/apis/litellm-api/changes/guardrails/validate_blocked_words_file/post.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flock/apis/litellm-api/revisions/b694deb1e459?raw)
