Apidog Docs
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
Discord Community
Slack Community
X / Twitter
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
  1. Pre and Post Processors
  • Apidog Learning Center
  • Getting Started
    • Introduction to Apidog
    • Basic Concepts in Apidog
    • Navigating Apidog
    • Quick Start
      • Overview
      • Creating an Endpoint
      • Making a Request
      • Adding an Assertion
      • Creating Test Scenarios
      • Sharing API Documentation
      • Explore More
    • Migration to Apidog
      • Overview
      • Manual Import
      • Scheduled Import (Bind Data Sources)
      • Import Options
      • Export Data
      • Import From
        • Import from Postman
        • Import OpenAPI Spec
        • Import cURL
        • Import Markdowns
        • Import from Insomnia
        • Import from apiDoc
        • Import .har File
        • Import WSDL
  • Design APIs
    • Overview
    • Create a New API Project
    • Endpoint Basics
    • APl Design Guidelines
    • Module
    • Configure Multiple Request Body Examples
    • Components
    • Common Fields
    • Global Parameters
    • Endpoint Change History
    • Comments
    • Batch Endpoint Management
    • Custom Protocol API
    • Schemas
      • Overview
      • Create a New Schema
      • Build a Schema
      • Generate Schemas from JSON Etc
      • oneOf, allOf, anyOf
      • Using Discriminator
    • Security Schemes
      • Overview
      • Create a Security Scheme
      • Use the Security Scheme
      • Security Scheme in Online Documentation
    • Advanced Features
      • Custom Endpoint Fields
      • Associated Test Scenarios
      • Endpoint Status
      • Appearance of Parameter Lists
      • Endpoint Unique Identification
  • Develop and Debug APIs
    • Overview
    • Generating Requests
    • Sending Requests
    • Debugging Cases
    • Test Cases
    • Dynamic Values
    • Validating Responses
    • Design-First vs Request-First
    • Generating Code
    • Environments & Variables
      • Overview
      • Environment Management
      • Using Variables
    • Vault Secrets
      • Overview
      • HashiCorp Vault
      • Azure Key Vault
      • AWS Secrets Manager
    • Pre and Post Processors
      • Assertion
      • Extract Variable
      • Wait
      • Overview
      • Using Scripts
        • Overview
        • Pre Processor Scripts
        • Post Processor Scripts
        • Public Scripts
        • Postman Scripts Reference
        • Calling Other Programming Languages
        • Using JS Libraries
        • Visualizing Responses
        • Script Examples
          • Assertion Scripts
          • Using Variables
          • Modifying Requests
          • Other Examples
      • Database Operations
        • Overview
        • MySQL
        • MongoDB
        • Redis
        • Oracle Client
    • Dynamic Values Modules
  • Mock API Data
    • Overview
    • Smart Mock
    • Custom Mock
    • Mock Priority Sequence
    • Mock Scripts
    • Cloud Mock
    • Self-Hosted Runner Mock
    • Mock Language (Locales)
  • API Testing
    • Overview
    • Test scenarios
      • Create a test scenario
      • Pass data between requests
      • Flow control conditions
      • Sync data from endpoints or endpoint cases
      • Import endpoints or endpoint cases from other projects
      • Export test scenarios
    • Run test scenarios
      • Run a test scenario
      • Run test scenarios in batch
      • Manage the runtime environment of APIs from other projects
      • Data-driven testing
      • Scheduled tasks
    • Test Suite
      • Overview
      • Create a test suite
      • Orchestrate test suite
      • Run test suite locally
      • Run test suites via CLI
      • Scheduled tasks
    • Test reports
      • Test reports
    • Test APIs
      • Integration testing
      • Performance testing
      • End-to-end testing
      • Regression testing
      • Contract testing
    • Apidog CLI
      • Overview
      • Installing and running Apidog CLI
      • Apidog CLI Options
    • CI CD
      • Overview
      • Integrate with Gitlab
      • Integrate with Jenkins
      • Trigger Test by Git Commit
      • Integrate with Github Actions
  • Publish API Docs
    • Overview
    • API Technologies Supported
    • Quick share
    • View the API documentation
    • Markdown documentations
    • Publish docs sites
    • Custom layouts
    • Custom CSS, JavaScript, HTML
    • Custom domain
    • LLM-friendly Features
    • SEO settings
    • Advanced Settings
      • Documentation Search
      • CORS Proxy
      • Integrating Google Analytics with Doc Sites
      • Folder tree settings
      • Visibility settings
      • Embedding values in document URLs
    • API Versions
      • Overview
      • Create API versions
      • Publish API versions
      • Share endpoints with API versions
  • Send requests
    • Overview
    • SSE debugging
    • Socket.IO
    • WebSocket
    • Webhook
    • SOAP or WebService
    • GraphQL
    • gRPC
    • Use request proxy agents for debugging
    • Create requests
      • Request History
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • Debug requests
      • Save the request as an endpoint
      • HTTP2
    • Response and cookies
      • Overview
      • API response in Apidog
      • Create and send cookies
    • Authentication and authorization
      • Overview
      • CA and client certificates
      • Authorization types supported by Apidog
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
  • Branches
    • Overview
    • Create a new sprint branch
    • Test APIs in a branch
    • Design API in a branch
    • Merge sprint branches
    • Manage sprint branches
  • AI Features
    • Overview
    • Enable AI features
    • Generate Test Cases
    • Modify schemas with AI
    • Endpoint compliance check
    • API documentation completeness check
    • AI naming
    • FAQs
  • Apidog MCP Server
    • Overview
    • Connect API Specification within Apidog Project to AI via Apidog MCP Server
    • Connect Online API Documentation Published by Apidog to AI via Apidog MCP Server
    • Connect OpenAPI Files to AI via Apidog MCP Server
  • Best Practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Offline Space
    • Overview
  • Administration
    • Onboarding Checklist
      • Basic Concepts
      • Onboarding Guide
    • Managing teams
      • Managing Teams
      • Managing Team Members
      • Member Roles & Permission Settings
      • Team Activities
      • Team Resources
        • General Runner
        • Team Variables
        • Request Proxy Agent
      • Real-time Collaborations
        • Team Collaboration
    • Managing Projects
      • Managing Projects
      • Managing Project Members
      • Notification Settings
      • Project Resources
        • Database Connection
        • Git Connection
    • Managing Organization
      • Managing Organization
      • Single Sign-On (SSO)
        • SSO Overview
        • Configure Microsoft Entra ID
        • Configure Okta
        • Configure SSO for an Organization
        • Managing user accounts
        • Mapping Groups to Teams
      • SCIM Provisioning
        • Intro to SCIM Provisioning
        • Microsoft Entra ID
        • Okta
      • Organization Resources
        • Self-hosted Runner
      • Plans management
        • Billing managers in organization
  • Billing
    • Overview
    • Credits
    • Unable to use credit cards
    • Managing subscriptions
    • Upgrade plan
    • How to move a paid team to a organization
  • Data & Security
    • Apidog data storage location and security
    • User data privacy and storage location
    • Request routing and data security
  • Add-ons
    • API Hub
    • Apidog Intellij IDEA plugin
    • Browser Extension
      • Chrome
      • Microsoft Edge
    • Request Proxy
      • Request proxy in Apidog web
      • Request proxy in shared docs
      • Request proxy in Apidog client
  • Account & preferences
    • Account settings
    • Generate OpenAPI access token
    • Notification
    • Language settings
    • Hot keys
    • Network proxy configuration
    • Data backup
    • Updating Apidog
    • Deleting account
    • Experimental Features
  • References
    • API-Design First Approach
    • Apidog OpenAPI Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Install Java Environment
    • Runner deployment environment
    • Apidog flavored Markdown
  • Apidog Europe
    • Apidog Europe
  • Support Center
  • Schemas
    • MinifiedFestivalType
    • DateType
    • LocationType
    • ArtistType
    • FestivalType
    • GetAllFestivalsResponseType
    • GetFestivalByIdResponseType
    • UserType
    • GetUserResponseType
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
Discord Community
Slack Community
X / Twitter
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
  1. Pre and Post Processors

Pre/Post Processors in Apidog

Pre and post-processors are a key feature in Apidog. When you send a request, you can use pre-processors to dynamically control your request, or use post-processors to handle the received response.
Apidog provides a visual, drag-and-drop interface for pre and post-request operations, complementing traditional script-based approaches. This visual interface allows you to configure common operations without writing code, while still supporting custom scripts for advanced use cases.

Quick Start#

Here are the steps to use pre and post-processors in Apidog:
1
Open any endpoint and navigate to the Run tab (Design-first Mode) or Request tab (Request-first mode).
Design-first Mode
Request-first Mode
Pre/Post Processors in Design Mode
2
Switch to the Pre Processors or Post Processors section, hover over + Add, and select the desired processor.
3
Fill in the necessary fields for the added processor.
4
Click Send, and the request will execute with the configured pre/post processors.
5
In Design-first Mode, click Save as case to save the request. In Request-first Mode, click Save or Save as case to save the request.
Design-first Mode
Request-first Mode
Save Case in Design Mode
TIP
You can also create a standalone request and apply pre/post-processors to it. However, we recommend leveraging pre/post-processors on top of the endpoint specification to make debugging and testing more streamlined.

Capabilities#

Pre and post processors can collectively achieve various functionalities:

Pre Processors#

Request Parameter Setup: Dynamically define input data for the API endpoint.
Header Configuration: Specify headers such as Content-Type, Accept, and Authorization.
Authentication: Add tokens, API keys, or credentials for protected endpoints.
Database Integration: Retrieve values from a database to use as request parameters.
Encryption: Secure the request payload before transmission.

Post Processors#

Assertions: Validate the received response against expected results (status codes, body content, etc.).
Variable Extraction: Extract values from the response to use in subsequent requests.
Database Operations: Write response data to a database for storage or updating.
Data Visualization: Generate reports or visual representations of the response data.

Available Processors#

Apidog supports the following pre/post processors:
ProcessorTypeDescription
AssertionPostDefine validation rules to check response data against expected values (status code, body, headers).
Extract VariablePostExtract values from the response (JSON, XML, Text) and store them as variables using JSONPath or XPath.
Database OperationPre/PostConnect to SQL/NoSQL databases to execute queries. Results can be stored as variables.
Custom ScriptsPre/PostWrite custom JavaScript code to handle complex logic. Access request/response data and environment variables.
Public ScriptsPre/PostCreate reusable script snippets shared across multiple processors or scenarios.
WaitPre/PostIntroduce a delay before or after a request, useful for simulating real-world latency.
We recommend using the Apidog Script Generator to simplify script writing. Describe your logic in natural language, and the generator will create a runnable script for you.

Execution Order#

Pre and post-processors can be configured at multiple levels:
1.
Run/Endpoint Case Level (Default): Affects only the current run/case.
2.
Endpoint Level: Applies to all cases associated with the endpoint.
3.
Folder Level: Impacts all endpoints within the folder.
4.
Project Level: Applies to all requests within the project (highest scope).
The execution flows from the highest level (Project/Folder) down to the specific Run/Case level.

Visualizing Execution#

A set of pre-processors in a request may look like this:
Pre-processor Execution Order
In the screenshot above:
The first three processors are grouped under Inherit from parent. They are defined in the Root folder, specific folders (e.g., "Pets"), or the endpoint itself.
These inherited processors are read-only in the current run but can be toggled on/off.
The last processor is a custom script added specifically for this run and can be edited directly.

Variable Substitution#

You may notice a step called Variable Substitution & Inherit from Parents. This special pre-processor replaces placeholders like {{variable}} with their actual values.
Default Behavior: Most pre-processors execute before variable substitution.
Post-Substitution: Some scripts (e.g., API signing) must run after variables are replaced. You can manually drag these processors below the "Variable Substitution" step.

Complete Execution Flow#

The detailed execution order for a single request is as follows:
Modified atΒ 2026-01-14 09:10:00
Previous
Wait
Next
Overview
Built with