Skip to main content

General Information

Policy Type

Endpoints

List Policies

Add Policy

Update Policy

Delete Policy


List Policies

Endpoint

Request

Headers

Path Parameters

Response

Success Response (200 OK)

cURL Example


Add Policy

Endpoint

Request

Headers

Path Parameters

Request Body

Full JSON Body Example
Full JSON Body Example - Validate Against OpenAPI Spec

Request Body Fields

operationMetadata
Enum: targetScope
  • ALL - Policy applies to all endpoints
  • ENDPOINT - Policy applies only to specified endpoint
Enum: targetPipeline
  • REQUEST - Executes in request pipeline (validates request body)
  • RESPONSE - Executes in response pipeline (validates response body)
  • ERROR - Executes in error pipeline
Enum: targetEndpointHTTPMethod
  • GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
policy

JSONPath Examples

  • $ - Root of JSON document
  • $.data - Data property at root
  • $.users[0] - First element in users array
  • $.request.body - Nested path

EnumOpenApiValidationMode

  • METHOD_BASED - Validates against the schema matching the request’s HTTP method and path. Each endpoint/method combination is validated against its own schema definition from the OpenAPI spec.
  • ALL_SCHEMAS - Validates against all schema definitions in the OpenAPI spec. The request body must conform to at least one of the defined schemas.

Note

  • Either schemaDefinitionList (manual schemas) or validateAgainstSpec: true (OpenAPI spec) must be provided.
  • If validateAgainstSpec: true, openApiValidationMode is required and schemaDefinitionList is ignored.
  • If validateAgainstSpec: false or not set, schemaDefinitionList must contain at least one schema definition.
  • pathForBody is optional. When set, it specifies which part of the JSON body to validate.
schemaDefinitionList
Each schema definition is an object with the following fields:

JSON Schema Format

The schemaBody must be a valid JSON Schema (draft-07 or compatible). Example:

Response

Success Response (200 OK)

cURL Example


Update Policy

Endpoint

Request

Headers

Path Parameters

Request Body

Full JSON Body Example
Note: Request body structure is the same as Add Policy. All fields should be provided for update.

Response

Success Response (200 OK)

cURL Example


Delete Policy

Endpoint

Request

Headers

Path Parameters

Request Body

Full JSON Body Example
Request Body Fields
operationMetadata

Response

Success Response (200 OK)

cURL Example


Notes and Warnings

  • Validation Modes: Two validation approaches are available:
    • Manual Schema: Provide your own JSON Schema definitions in schemaDefinitionList (default)
    • OpenAPI Spec: Set validateAgainstSpec: true to validate against the API Proxy’s OpenAPI specification. Requires openApiValidationMode:
      • METHOD_BASED - Validates against the schema for the specific HTTP method and path
      • ALL_SCHEMAS - Validates against all schemas in the spec
  • Error Reporting: showFirstErrorOnly controls whether only the first error (default) or all validation errors are returned. Set to false for detailed error reports during development.
  • JSONPath: pathForBody is optional. When set, it specifies which part of the JSON body to validate using a JSONPath expression.
  • Schema Definition: When not using OpenAPI spec validation, schemaDefinitionList must contain at least one schema definition.
  • JSON Schema: schemaBody must be a valid JSON Schema (draft-07 or compatible)
  • Schema Number: schemaNo is used for ordering when multiple schemas are defined
  • Root Schema: Set rootSchema: true for the primary schema
  • Validation Failure: When validation fails, the request/response is rejected with an error
  • Performance: Schema validation adds processing overhead. Use for critical validation only.
  • Pipeline:
    • REQUEST pipeline validates request body before processing
    • RESPONSE pipeline validates response body before sending to client
  • Error Messages: Configure error messages in the policy to customize validation error responses
  • Deployment: Policy changes require deployment to take effect. Set deploy: true or deploy manually.