Site · API
Creating an Authorization Policy
Last updated 18 November 2026
Creating an Authorization Policy defines a reusable security rule you can attach to one or more Custom API Endpoints. Each policy evaluates incoming requests against your custom logic, granting or denying access before your endpoint code runs.
- Navigate to API from the main menu.
- Select Authorization Policies.
- Select CREATE AUTHORIZATION POLICY.
- Fill out the Details tab (explained below).
- Switch to the Body tab and write your policy logic.
- Select CREATE POLICY to save.
Details
The Details tab controls the policy identity and how it responds when access is denied. The File Path drives the system Name field, which is what you will see when assigning this policy to Custom API Endpoints.
| Input Label | Type | Required | Description |
|---|---|---|---|
| Policy Name | Text | Yes | A descriptive display name for the policy. Used to identify it in the list view and when assigning to endpoints. |
| Flash Alert | Text | No | The message shown to users when this policy blocks their request. |
| File Path | Text with folder picker | Yes | The file location for the policy. If you leave it empty, it is filled in from the Policy Name when you leave that field. Use the folder picker to select the correct module path. |
| Name | Text (read-only) | No | The system identifier for the policy, derived automatically from the File Path. This is the name you will see when assigning the policy to Custom API Endpoints. |
| HTTP Status | Number | No | The HTTP status code returned when the policy blocks a request. For example, use 403 for Forbidden. |
| Redirect To | Text | No | A URL to redirect users to when access is denied. Your Site URL is shown as a prefix for reference. |
Note
The Name field is generated from the File Path and cannot be edited directly. This is the identifier you will see when assigning the policy to Custom API Endpoints.
Body
The Body tab contains the Liquid logic that determines whether a request is allowed. When the expression evaluates to true, access is granted and the request proceeds to the endpoint. When it evaluates to anything else, access is denied and the policy response (Flash Alert, HTTP Status, or Redirect To) is applied.
| Input Label | Type | Required | Description |
|---|---|---|---|
| Content | Code editor | Yes | The Liquid logic that defines the policy condition. Return true to grant access, or any other value to deny it. |