General Information
Policy Type
Endpoints
List Policies
Add Policy
Update Policy
Delete Policy
List Policies
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
Response
Success Response (200 OK)
cURL Example
Add Policy
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Request Body
Full JSON Body Example - Header-Based Authentication
Full JSON Body Example - Parameter-Based Authentication
Full JSON Body Example - Body-Based Authentication
Request Body Fields
operationMetadata
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| targetScope | string | Yes | - | Policy scope: ALL or ENDPOINT |
| targetEndpoint | string | No* | - | Endpoint path (required if targetScope=ENDPOINT) |
| targetEndpointHTTPMethod | string | No* | - | HTTP method (required if targetScope=ENDPOINT) |
| targetPipeline | string | Yes | - | Pipeline: REQUEST, RESPONSE, or ERROR |
| deploy | boolean | No | true | Whether to deploy after adding policy |
| deployTargetEnvironmentNameList | array | No | [] | List of environment names to deploy to |
| order | integer | No | null | Policy execution order (starts from 1) |
ALL- Policy applies to all endpointsENDPOINT- Policy applies only to specified endpoint
REQUEST- Executes in request pipeline (authenticates request)RESPONSE- Executes in response pipelineERROR- Executes in error pipeline
GET,POST,PUT,DELETE,PATCH,OPTIONS,HEAD
policy
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | - | Policy type: policy-auth-clear-text |
| description | string | No | - | Policy description |
| active | boolean | No | true | Whether policy is active |
| usernameVar | object | Yes | - | Variable for extracting username |
| passwordVar | object | No* | - | Variable for extracting password (required if checkPassword=true) |
| checkPassword | boolean | No | true | Whether to check password during authentication |
| clearAuth | boolean | No | false | Clear authentication data after validation |
| addUserToHeader | boolean | No | false | Add authenticated user to header |
| userHeaderName | string | No* | - | Header name for authenticated user (required if addUserToHeader=true) |
Note
usernameVaris required.- If
checkPassword: true,passwordVaris required. - If
addUserToHeader: true,userHeaderNameis required.
usernameVar / passwordVar
Variable object with the following fields:| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Variable type: HEADER, PARAMETER, BODY, CONTEXT_VALUES, CUSTOM |
| headerName | string | No* | Header name (required if type=HEADER) |
| paramName | string | No* | Parameter name (required if type=PARAMETER) |
| bodyJsonPath | string | No* | JSON path (required if type=BODY for JSON) |
| bodyXPath | string | No* | XPath (required if type=BODY for XML) |
| contextValue | string | No* | Context value (required if type=CONTEXT_VALUES) |
EnumVariableType
HEADER- Extract from HTTP headerPARAMETER- Extract from query/path parameterBODY- Extract from request body (JSON path or XPath)CONTEXT_VALUES- Extract from context valuesCUSTOM- Extract from custom variable
JSON Path Examples
$.username- Root level field$.user.name- Nested field$.users[0].name- Array element
XPath Examples
/root/username- Absolute path//username- Anywhere in document/root/user[@id='1']/name- With attribute condition
Response
Success Response (200 OK)
cURL Example
Update Policy
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Request Body
Full JSON Body Example
Response
Success Response (200 OK)
Delete Policy
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Request Body
Full JSON Body Example
Response
Success Response (200 OK)
Notes and Warnings
-
Username Variable:
usernameVaris required and must specify where to extract username -
Password Variable:
passwordVaris required ifcheckPassword: true -
Password Checking: When
checkPassword: true, password is validated against user store -
Clear Auth: When
clearAuth: true, authentication data is removed after validation -
Add User to Header: When
addUserToHeader: true, authenticated username is added to specified header -
User Header Name: Required if
addUserToHeader: true -
Variable Types:
HEADER- Extract from HTTP headerPARAMETER- Extract from query/path parameterBODY- Extract from request body (JSON path or XPath)CONTEXT_VALUES- Extract from context values
-
JSON Path: Use JSON path syntax for JSON body (e.g.,
$.username,$.user.name) -
XPath: Use XPath syntax for XML body (e.g.,
/root/username,//username) - Security: Clear text authentication transmits credentials in plain text. Use HTTPS only.
- Performance: Authentication adds processing overhead. Use for necessary authentication only.
-
Pipeline:
REQUESTpipeline authenticates request before forwarding- Authentication failure results in 401 Unauthorized response
- Error Handling: Invalid credentials or missing variables cause authentication to fail
-
Deployment: Policy changes require deployment to take effect. Set
deploy: trueor deploy manually.
Related Documentation
- List Policies - List all policies
- Add Policy - General policy addition guide
- Update Policy - General policy update guide
- Delete Policy - General policy deletion guide
- Basic Authentication Policy - HTTP Basic Authentication
- Digest Authentication Policy - HTTP Digest Authentication

