# Create a guardrail

> Creates a new guardrail in the project, archiving its document as version 1. The `document` is validated on write: `class` must be a literal (A/B/C/D) or a JSON Logic expression, and every variable it (and `guard`) reference must resolve to the `args.*` / `context.*` / `runtime.*` namespaces — an out-of-catalog `runtime.*` key is rejected with 400.

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create a guardrail"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/guardrails"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Creates a new guardrail in the project, archiving its document as version 1. The `document` is validated on write: `class` must be a literal (A/B/C/D) or a JSON Logic expression, and every variable it (and `guard`) reference must resolve to the `args.*` / `context.*` / `runtime.*` namespaces — an out-of-catalog `runtime.*` key is rejected with 400.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
>
  <Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails>
  
</ParamsDetails>

<RequestSchema
  {...require("./create-guardrail.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./create-guardrail.StatusCodes.json")}
>
  
</StatusCodes>
