---
title: "Post Check Endpoint"
method: POST
path: "/v1/check"
tags: ["Guardrails"]
---

# Post Check Endpoint

`POST /v1/check`

## Request

- Base URL: `https://api.pharia.example.com`
- URL: `https://api.pharia.example.com/v1/check`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/aleph-alpha/apis/stateful-responses/docs/v1/check/post.ts> (a function with typed inputs; its response is checked against the schema)

Check content against guardrails for an application.

The v1 shape: v2-only fields such as ``streaming_allowed`` are dropped.

## Request body

- CheckRequest: Inbound request to check content against guardrails.
  - `application_id` string, nullable
  - `check_type` 'input' | 'output', required: A point in the request lifecycle a guardrail policy can check. The single registry every ``check_types`` key and ``CheckRequest.check_type`` must belong to. Adding a checkpoint (``tool_input``, ``tool_output``, ...) means adding one member here plus its effect-table row, not new branching at each call site.
  - `input` string, required
  - `context` CheckContext: Framing information for a check, carried alongside the content. ``checkpoint`` is the checkpoint being evaluated. ``user_prompt`` is the real user turn that preceded the content under check, when the caller has one. For an ``output`` check it drives the Llama Guard agent-response framing: with a ``user_prompt``, the conversation holds a user turn then an agent turn; without one, the agent turn alone.
    - `checkpoint` 'input' | 'output', required: A point in the request lifecycle a guardrail policy can check. The single registry every ``check_types`` key and ``CheckRequest.check_type`` must belong to. Adding a checkpoint (``tool_input``, ``tool_output``, ...) means adding one member here plus its effect-table row, not new branching at each call site.
    - `user_prompt` string, nullable
  - `images` GuardrailImage[]
    - `search_store_id` string, required
    - `file_id` string, required
  - `unreferenced_image_count` integer
  - `if_unconfigured` 'error' | 'allow'

## Response `200`

Successful Response

- CheckResponse: Result of a guardrail check.
  - `safe` boolean, required
  - `violations` Violation[], required
    - `category` string, required
    - `provider` string, required
    - `stage` string, required
    - `step` integer, required
    - `reason` string, nullable
  - `action` 'allow' | 'label' | 'block': What happens to a message a guardrail flagged. ``ALLOW`` passes it to the model untouched. ``LABEL`` passes it together with a notice naming the flagged categories, so the model can decline or answer only the harmless part. ``BLOCK`` stops the request before it reaches the model.
  - `evaluated` boolean
  - `configured_checkpoints` Checkpoint[], nullable

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `413`: Content Too Large
- `422`: Validation errors are returned as 400, not 422. This entry exists because FastAPI generates it automatically.
- `425`: Too Early
- `500`: Internal Server Error
- `501`: Not Implemented
- `502`: Bad Gateway

---

[API](https://skmtc.dev/aleph-alpha/apis/stateful-responses.md) - [All operations](https://skmtc.dev/aleph-alpha/apis/stateful-responses/llms.txt) - [OpenAPI document](https://skmtc.dev/aleph-alpha/apis/stateful-responses/revisions/2747297acb54?raw)
