Application Policies

The Policies API allows you to retrieve and manage the policies of your applications.

List all policies

Lists all policies for a specific application in Access Gateway

Request
path Parameters
applicationId
required
string <uuid>

Identifier of the application

Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

429

Too Many Requests

get/api/v2/apps/{applicationId}/policies
Request samples
Response samples
application/json
{
  • "id": "9ef3103a-50a7-4517-92d6-442612b6d5c1",
  • "name": "root",
  • "description": "Protect all application resources",
  • "resourcePath": "/",
  • "active": true,
  • "rule": "PROTECTED",
  • "regexRule": null,
  • "caseSensitive": true,
  • "customDirective": null
}

Create a policy

Creates a policy for an application in Access Gateway

Policies define access rules and conditions for the application. The application must have protected resources defined before you can create policies.

Request
path Parameters
applicationId
required
string <uuid>

Identifier of the application

Request Body schema: application/json
required
name
required
string

Policy name

resourcePath
required
string

The path to the resource that the policy manages

rule
required
string

Policy type

See Policy types

Enum: 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

active
boolean
Default: true

Policy status

caseSensitive
boolean
Default: true

Indicates whether the policy resource is case sensitive

customDirective
string <multi-line string>

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.

description
string

Policy description

regexRule
string

Regular expression (regex) that can control authorization for the given resource

See Protected Rule resource-matching rule expressions.

Responses
200

Policy created successfully

400

Bad Request

401

Unauthorized

403

Forbidden

429

Too Many Requests

post/api/v2/apps/{applicationId}/policies
Request samples
application/json
{
  • "name": "root",
  • "description": "Protect all application resources",
  • "resourcePath": "/",
  • "rule": "PROTECTED"
}
Response samples
application/json
{
  • "id": "9ef3103a-50a7-4517-92d6-442612b6d5c1",
  • "name": "root",
  • "description": "Protect all application resources",
  • "resourcePath": "/",
  • "active": true,
  • "rule": "PROTECTED",
  • "regexRule": null,
  • "caseSensitive": true,
  • "customDirective": null
}

Retrieve a policy

Retrieves details of a specific policy for an application by applicationId and policyId

Request
path Parameters
applicationId
required
string <uuid>

Identifier of the application

policyId
required
string <uuid>

Identifier of the policy

Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

get/api/v2/apps/{applicationId}/policies/{policyId}
Request samples
Response samples
application/json
{
  • "id": "9ef3103a-50a7-4517-92d6-442612b6d5c1",
  • "name": "root",
  • "description": "Protect all application resources",
  • "resourcePath": "/",
  • "active": true,
  • "rule": "PROTECTED",
  • "regexRule": null,
  • "caseSensitive": true,
  • "customDirective": null
}

Replace a policy

Replaces an existing policy configuration for an application

Request
path Parameters
applicationId
required
string <uuid>

Identifier of the application

policyId
required
string <uuid>

Identifier of the policy

Request Body schema: application/json
required
active
boolean
Default: true

Policy status

caseSensitive
boolean
Default: true

Indicates whether the policy resource is case sensitive

customDirective
string <multi-line string>

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.

description
string

Policy description

name
string

Policy name

regexRule
string

Regular expression (regex) that can control authorization for the given resource

See Protected Rule resource-matching rule expressions.

resourcePath
string

The path to the resource that the policy manages

rule
string

Policy type

See Policy types

Enum: 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

Responses
200

policy updated successfully

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

put/api/v2/apps/{applicationId}/policies/{policyId}
Request samples
application/json
{
  • "name": "root",
  • "description": "Protect all application resources",
  • "resourcePath": "/",
  • "rule": "PROTECTED"
}
Response samples
application/json
{
  • "id": "9ef3103a-50a7-4517-92d6-442612b6d5c1",
  • "name": "root",
  • "description": "Protect all application resources",
  • "resourcePath": "/",
  • "active": true,
  • "rule": "PROTECTED",
  • "regexRule": null,
  • "caseSensitive": true,
  • "customDirective": null
}

Delete a policy

Deletes a policy for an application by applicationId and policyId

Request
path Parameters
applicationId
required
string <uuid>

Identifier of the application

policyId
required
string <uuid>

Identifier of the policy

Responses
204

Policy deleted successfully

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

delete/api/v2/apps/{applicationId}/policies/{policyId}
Request samples
Response samples
application/json
{
  • "details": { },
  • "errorCode": "BAD_REQUEST",
  • "message": "Request validation failed"
}