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 - XML to XML Transformation
Full JSON Body Example - XML to JSON Transformation
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 (transforms request body)RESPONSE- Executes in response pipeline (transforms response body)ERROR- Executes in error pipeline
GET,POST,PUT,DELETE,PATCH,OPTIONS,HEAD
policy
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | - | Policy type: policy-xml-transformation |
| description | string | No | - | Policy description |
| active | boolean | No | true | Whether policy is active |
| transformationType | string | Yes | XML2XML | Transformation type: XML2XML or XML2JSON |
| xsltValue | string | No* | - | XSLT stylesheet (required if transformationType=XML2XML) |
| xmlToJsonUnwrapElement | boolean | No | false | Unwrap root element in JSON output |
| xmlToJsonIgnoreNull | boolean | No | false | Ignore null values when converting to JSON |
| xmlToJsonIgnoreEmpty | boolean | No | false | Ignore empty values when converting to JSON |
| xmlToJsonNumbersAsStrings | boolean | No | false | Convert numbers to strings in JSON |
| xmlToJsonUseNullForNil | boolean | No | false | Use null for xsi:nil attributes |
| xmlToJsonArrayPathList | array | No | [] | XPath expressions for array elements |
EnumXmlTransformationType
XML2XML- Transform XML to XML using XSLT stylesheetXML2JSON- Convert XML to JSON format
XSLT Stylesheet
XSLT (eXtensible Stylesheet Language Transformations) is used for XML-to-XML transformations. It supports:- Template matching
- Element/attribute selection
- Value extraction
- Conditional logic
- Loops and iterations
XML to JSON Options
xmlToJsonUnwrapElement: Whentrue, removes root wrapper element from JSONxmlToJsonIgnoreNull: Whentrue, null values are omitted from JSONxmlToJsonIgnoreEmpty: Whentrue, empty strings/elements are omitted from JSONxmlToJsonNumbersAsStrings: Whentrue, numeric values are converted to stringsxmlToJsonUseNullForNil: Whentrue, usesnullforxsi:nil="true"attributesxmlToJsonArrayPathList: XPath expressions that identify elements to convert as arrays
Note
transformationTypeis required.- If
transformationType: XML2XML,xsltValueis required. - XML-to-JSON options are only used when
transformationType: XML2JSON.
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
-
Transformation Type:
XML2XML- Uses XSLT stylesheet for transformation (requiresxsltValue)XML2JSON- Converts XML to JSON format (uses XML-to-JSON options)
-
XSLT Stylesheet:
- Must be valid XSLT 1.0 or 2.0
- Supports template matching, element selection, value extraction
- See XSLT documentation for detailed syntax
-
XML to JSON Options:
xmlToJsonUnwrapElement: Remove root wrapper element from JSONxmlToJsonIgnoreNull: Omit null values from JSON outputxmlToJsonIgnoreEmpty: Omit empty strings/elements from JSONxmlToJsonNumbersAsStrings: Convert numeric values to stringsxmlToJsonUseNullForNil: Usenullforxsi:nil="true"attributesxmlToJsonArrayPathList: XPath expressions for array conversion
-
Array Paths: XPath expressions in
xmlToJsonArrayPathListidentify elements to convert as JSON arrays - Performance: XML transformation adds processing overhead. Use for necessary transformations only.
-
Pipeline:
REQUESTpipeline transforms request body before forwardingRESPONSEpipeline transforms response body before sending to client
- Error Handling: Invalid XSLT or malformed XML will cause transformation 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
- JSON Transformation Policy - Transform JSON messages

