Documentation Index
Fetch the complete documentation index at: https://unkey.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Unkey Deploy is in public beta. To try it, open the product switcher in the
top-left of the dashboard and select Deploy. During beta, deployed
resources are free. We’re eager for feedback, so let us know what you think
on Discord, X, or
email support@unkey.com.
400 Bad Request before they reach your app.
When to use it
Add an OpenAPI validation policy when you want to:- Reject malformed requests at the gateway, so your app only handles well-formed input
- Enforce a contract between your API and its clients without writing per-route validation in your code
- Surface schema drift early — clients sending requests that don’t match the spec get a clear
400instead of an opaque server error
What gets validated
The Sentinel validates the following parts of each request against your spec:- Path parameters
- Query parameters
- Request headers
- Request body (content type and schema)
Configuration
The OpenAPI validation policy uses your application’s auto-scraped OpenAPI specification — there is no separate spec input on the policy itself.- Configure the OpenAPI spec path in your app’s networking settings (for example,
/openapi.yamlor/api/spec.json). Unkey scrapes the spec from your running deployment. - Navigate to your project’s Sentinel Policies page.
- Create a new policy and select OpenAPI Validation as the policy type.
- Optionally configure match conditions to scope validation to specific routes.
- Save the policy.
If your app doesn’t expose an OpenAPI spec at the configured path, the policy has no spec to validate against. Set the OpenAPI spec path in your app settings before enabling the policy.
Error response
When a request fails validation, the Sentinel returns a structured error following the standard error format:detail field includes the specific validation failure (for example, missing required field, type mismatch, or unknown operation) to help clients fix the request.
