Replaces an existing policy configuration for an application
This operation is a full replace, not a partial update. The request body must include every required field (name, resourcePath, and rule). Any other optional field that you omit is reset to its default.
Custom NGINX directives that handle special requirements not covered by the policy type. There is no limit to the number of directives you can add, but each directive must be on its own line.
Regular expression (regex) that can control authorization for the given resource
Policy type
See Policy types
| Enum Value | Description |
|---|---|
| NO_AUTH | The resource is not protected by any policy |
| PROTECTED | This policy requires a valid session (authenticated user) to access the associated resource |
| PROTECTED_REGEX | This policy requires a valid session and an expression that determines who can access the resource |
| ADAPTIVE | This policy extends the Not Protected policy, but passes header information to the underlying app |
| CUSTOM | This policy extends the Protected Rule policy, but supports entering a regular expression as the URI |
- https://oag.domain.tldhttps://oag.domain.tld/api/v2/apps/{applicationId}/policies/{policyId}
curl -i -X PUT \
'https://oag.domain.tld/api/v2/apps/{applicationId}/policies/{policyId}' \
-H 'Content-Type: application/json' \
-d '{
"name": "root",
"description": "Protect all application resources",
"resourcePath": "/",
"rule": "PROTECTED"
}'policy updated successfully
Custom NGINX directives that handle special requirements not covered by the policy type. There is no limit to the number of directives you can add, but each directive must be on its own line.
Regular expression (regex) that can control authorization for the given resource
Policy type
See Policy types
| Enum Value | Description |
|---|---|
| NO_AUTH | The resource is not protected by any policy |
| PROTECTED | This policy requires a valid session (authenticated user) to access the associated resource |
| PROTECTED_REGEX | This policy requires a valid session and an expression that determines who can access the resource |
| ADAPTIVE | This policy extends the Not Protected policy, but passes header information to the underlying app |
| CUSTOM | This policy extends the Protected Rule policy, but supports entering a regular expression as the URI |
{ "id": "9ef3103a-50a7-4517-92d6-442612b6d5c1", "name": "root", "description": "Protect all application resources", "resourcePath": "/", "active": true, "rule": "PROTECTED", "regexRule": null, "caseSensitive": true, "customDirective": null }