Apidog Docs
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
  1. Branches
  • 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
    • Spec-first Mode (Beta)
    • 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
    • API Debugging
      • AI Agent Debugger
      • A2A Debugger
    • Environments & Variables
      • Overview
      • Using Variables
      • Environment Management
    • Vault Secrets
      • Overview
      • HashiCorp Vault
      • Azure Key Vault
      • AWS Secrets Manager
    • Pre and Post Processors
      • Overview
      • Assertion
      • Extract Variable
      • Wait
      • Security
      • Database Operations
        • Overview
        • MySQL
        • MongoDB
        • Redis
        • Oracle Client
      • 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
    • 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 and Endpoint Cases
      • Import Endpoints and Endpoint Cases from Other Projects
      • Export Test Scenarios
    • Run Test Scenarios
      • Run a Test Scenario
      • Run Test Scenarios in Batch
      • Data-Driven Testing
      • Shared Test Data
      • Scheduled Tasks
      • Manage Runtime Environment of APIs from Other Projects
    • Test Suite
      • Overview
      • Create A Test Suite
      • Orchestrate Test Suite
      • Run Test Suites 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 Github Actions
      • Integrate with Gitlab
      • Integrate with Jenkins
      • Trigger Test by Git Commit
  • Publish API Docs
    • Overview
    • API Technologies Supported
    • Quick Share
    • Viewing API Documentation
    • Markdown Documentation
    • Publishing Documentation Sites
    • Custom Login Page
    • Custom Layouts
    • Custom CSS, JavaScript, HTML
    • Custom Domain
    • AI Features
    • SEO Settings
    • Advanced Settings
      • Documentation Search
      • CORS Proxy
      • Integrating Google Analytics
      • Folder Tree Settings
      • Visibility Settings
      • Embedding Values in Document URLs
    • API Versions
      • Overview
      • Creating API Versions
      • Publishing API Versions
      • Sharing Endpoints with API Versions
  • Send Requests
    • Overview
    • SSE Debugging
    • MCP Client
    • 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
      • Saving Requests as Endpoints
      • HTTP/2
    • Response and Cookies
      • Viewing API Responses
      • Managing Cookies
      • Overview
    • Authentication and Authorization
      • Overview
      • CA and Client Certificates
      • Authorization Types
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
  • Branches
    • Overview
    • Creating a Sprint Branch
    • Testing APIs in a Branch
    • Designing APIs in a Branch
    • Merging Sprint Branches
    • Managing Sprint Branches
    • AI Branch (Beta)
  • AI Features
    • Overview
    • Enabling AI Features
    • Generating Test Cases
    • Modifying Schemas with AI
    • Endpoint Compliance Check
    • API Documentation Completeness Check
    • AI-Powered Field Naming
    • FAQs
  • Apidog MCP Server
    • Overview
    • Connect Apidog Project to AI
    • Connect Published Documentation to AI
    • Connect OpenAPI Files to AI
  • Best Practices
    • Handling API Signatures
    • Accessing OAuth 2.0 Protected APIs
    • Collaboration Workflow
    • Managing Authentication State
  • Offline Space
    • Overview
  • Administration
    • Onboarding Checklist
      • Basic Concepts
      • Onboarding Guide
    • Managing Projects
      • Managing Projects
      • Managing Project Members
      • Notification Settings
      • Project Resources
        • Database Connection
        • Git Connection
    • Managing Teams
      • Managing Teams
      • Managing Team Members
      • Team Activities
      • Team Roles & Permissions
      • Team Resources
        • General Runner
        • Team Variables
        • Request Proxy Agent
      • Real-time Collaborations
        • Team Collaboration
    • Managing Organization
      • Managing Organization
      • Organization Role & Permissions
      • Single Sign-On (SSO)
        • SSO Overview
        • Configuring Microsoft Entra ID
        • Configuring Okta
        • Configuring SSO for an Organization
        • Managing User Accounts
        • Mapping Groups to Teams
      • SCIM Provisioning
        • Introduction to SCIM Provisioning
        • Microsoft Entra ID
        • Okta
      • Plans Management
        • Billing Managers in Organizations
      • Organization Resources
        • Self-Hosted Runner
  • Billing
    • Overview
    • Credits
    • Upgrading Your Plan
    • Alternative Payment Methods
    • Managing Subscriptions
    • Moving Paid Teams to Organizations
  • Data & Security
    • Data Storage and Security
    • User Data Privacy and Security
    • Request Routing and Data Security
  • Add-ons
    • API Hub
    • Apidog Intellij IDEA Plugin
    • Browser Extension
      • Chrome
      • Microsoft Edge
    • Request Proxy
      • Request Proxy in Web
      • Request Proxy in Shared Docs
      • Request Proxy in Client
  • Account & Preferences
    • Account Settings
    • Generating OpenAPI Access Token
    • Notification
    • Language Settings
    • Hot Keys
    • Network Proxy Configuration
    • Backing Up Data
    • Updating Apidog
    • Deleting Account
    • Experimental Features
  • References
    • API Design-First Approach
    • Apidog OpenAPI Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Installing Java Environment
    • Runner Deployment Environment
    • Apidog Markdown Syntax
    • Apidog Swagger Extensions
      • Overview
      • x-apidog-folder
      • x-apidog-status
      • x-apidog-name
      • x-apidog-maintainer
    • Apidog JSON Schema Extensions
      • Overview
      • x-apidog-mock
      • x-apidog-orders
      • x-apidog-enum
  • Apidog Europe
    • Apidog Europe
  • Support Center
  1. Branches

AI Branch (Beta)

AI Branch is a special type of Sprint Branch.
All edit operations initiated from Apidog CLI are treated as initiated by AI / AI Agents by default.
AI Branch is designed to provide AI Agents with an isolated editing branch in Apidog projects. With AI Branch, AI can create and update project resources without directly changing the main branch or a standard sprint branch. After the changes are complete, users can review the differences in the client or CLI, then merge the results into the target branch directly or through a merge request.

Why AI Branch Is Needed#

AI-initiated edits can be unpredictable, while Apidog CLI provides a wide range of editing capabilities. AI Branch is designed for these higher-risk AI-initiated editing operations, allowing AI Agents to edit project resources within a controlled scope.
You can also upgrade to Apidog 2.8.31 or later and enable direct edit permissions for the main branch, standard sprint branches, and general branches as needed under Project Settings -> Feature Settings -> External AI Edit Permissions. Once enabled, these permissions bypass the direct-edit restrictions that normally require AI Branch.

What Is AI Branch?#

AI Branch is a special sprint branch. Like a standard sprint branch, it stores changes to project resources. However, it is intended by default for external AI operations, such as CLI-based edits, and keeps a human confirmation step before changes are merged.
Key characteristics of AI Branch include:
1.
Isolated editing: Changes made from the CLI to resources such as APIs, documentation, data models, and test scenarios are stored in the AI Branch and do not directly affect the main branch or the source branch.
2.
Clear source: AI Branches cannot be created directly in the Apidog client. They must be created from a CLI or MCP source. An AI Branch records its source branch and is usually merged back into that source branch, making it easier to understand the context of AI-generated changes.
3.
Human confirmation: Changes in an AI Branch must be confirmed by a user before they are merged. Users can review differences, select the resource scope, and choose whether to merge directly or create a merge request.
4.
No quantity limit: There is currently no active limit on the number of AI Branches that can be created. AI Agents can use them to process data by business domain, iteration, or feature.
5.
Automatic archiving: To prevent uncontrolled growth of AI Branches during project collaboration, each AI Branch is compared with its source branch every 24 hours. If no differences are found, it is automatically archived. You can restore archived AI Branches in Apidog at any time, or recreate new AI Branches from Apidog CLI, without any limit.
TIP
AI Branch is used to store write results from external AI or CLI operations. Normal in-client editing, merging, and review by users still follow project member permissions and branch protection rules.

Use Cases#

AI Branch is suitable when AI needs to participate in project resource maintenance while branch isolation and human confirmation must still be preserved.
ScenarioDescription
Generate API drafts from codeAfter reading the code, AI creates or updates HTTP API endpoints in an AI Branch. Users confirm the changes before merging.
Organize API resources in bulkAI can adjust API directories, add descriptions, and update data models or response components without directly affecting the current collaboration branch.
Generate automated test draftsAI can create test scenarios, test cases, or test data in an AI Branch for later confirmation by testers.
Fill gaps in API documentationAI can supplement missing fields based on bug reports, API implementations, or OpenAPI files.
Batch write in CI/CDAutomated workflows can write generated results into an AI Branch and wait for user review before merging.

Basic Workflow#

A typical AI Branch workflow is as follows:
1
Create an AI Branch and specify the source branch it is based on.
2
Import the resources that need to be edited into the AI Branch, or create new resources in the AI Branch.
3
An AI Agent, CLI, or automation script modifies resources in the AI Branch.
4
The user reviews the differences between the AI Branch and the source branch, then confirms the resource scope to be merged.
5
Depending on the target branch protection rules, merge directly or create a merge request.

Create an AI Branch#

Use branch create --type ai to create an AI Branch. The legacy sprint-branch and sb entry points remain compatible, but the unified branch entry point is recommended.
CommandDescriptionExample
branch create --type aiCreate an AI Branch.apidog branch create --project <projectId> --type ai --name "ai/20260312-from-main-userRegister" --from main
branch list --type aiView AI Branches in a project.apidog branch list --project <projectId> --type ai
branch list --type allView all branch types in a project.apidog branch list --project <projectId> --type all
branch get --type aiView details of a specified AI Branch, including its branch type and source information.apidog branch get <branchName> --project <projectId> --type ai
Example: Create an AI Branch for the user registration API
TIP
We recommend naming AI Branches in the format ai/YYYYMMDD-from-sourceBranch-featureOrModule, for example, ai/20260312-from-main-userRegister. A clear name helps the team understand the branch source, purpose, and creation time.

Edit Resources in an AI Branch#

When the CLI writes project resources, you can use branch parameters to write those resources into an AI Branch. Parameters vary slightly across resource commands. Before use, check the corresponding command help and JSON Schema.
Resource TypeCommon CommandsExample
HTTP API endpointendpoint create, endpoint updateapidog endpoint create --project <projectId> --branch <aiBranchName> --file ./endpoint.json
Data modelschema create, schema updateapidog schema update <schemaId> --project <projectId> --branch <aiBranchName> --file ./schema.json
Markdown documentdoc create, doc updateapidog doc create --project <projectId> --branch <aiBranchName> --file ./doc.json
Test scenariotest-scenario create, test-scenario updateapidog test-scenario update <scenarioId> --project <projectId> --branch <aiBranchName> --file ./scenario.json
Test suitetest-suite create, test-suite updateapidog test-suite create --project <projectId> --branch <aiBranchName> --file ./suite.json
Test datatest-data create, test-data updateapidog test-data create --project <projectId> --branch <aiBranchName> --file ./test-data.json
When creating or updating complex resources, we recommend using cli-schema first to view and validate the data structure.

Import Resources from the Source Branch#

If an AI Branch needs to modify existing resources, use branch pick-to first to import resources from the source branch into the AI Branch. After import, AI can continue editing those resources in the AI Branch.
CommandDescriptionExample
branch pick-toImport resources from a source branch into a target AI Branch.apidog branch pick-to --project <projectId> --from <sourceBranchName> --to <aiBranchName> --endpoint-ids <ids>
Example: Import endpoints and let AI modify them
TIP
pick-to imports only the resources explicitly specified in the command. If directories, data models, response components, or other related resources are required, confirm the resource scope before importing.

View AI Branch Changes#

Before merging, we recommend previewing the candidate changes between the AI Branch and the target branch. The CLI can use merge-request preview to scan currently supported resource types. You can also view more complete branch differences in the client.
CommandDescriptionExample
merge-request previewScan candidate changes to confirm the resource scope before merging.apidog merge-request preview --project <projectId> --from <aiBranchName> --to <targetBranchName>
branch get --type aiView basic AI Branch information.apidog branch get <aiBranchName> --project <projectId> --type ai
Example: Preview candidate changes before merging
TIP
merge-request preview scans candidate differences for resource types currently supported by the CLI. It is not a complete resource diff. Before the final merge, we still recommend confirming important resource content in the client.

Merge an AI Branch#

After the AI Branch changes are complete, you can merge them back into the source branch or another target branch. For unprotected target branches, use branch merge to merge directly. For protected main branches, use merge-request create to create a merge request and go through the review process.
CommandDescriptionExample
branch mergeDirectly merge specified resources from an AI Branch.apidog branch merge --project <projectId> --from <aiBranchName> --to <targetBranchName> --endpoint-ids <ids>
merge-request createCreate a merge request.apidog merge-request create --project <projectId> --from <aiBranchName> --to <targetBranchName> --reviewer-ids <userIds> --endpoint-ids <ids>
merge-request approveApprove a merge request.apidog merge-request approve <mergeRequestId> --project <projectId> --to <targetBranchName> --file ./approve.json
merge-request rejectReject a merge request.apidog merge-request reject <mergeRequestId> --project <projectId> --to <targetBranchName>
Example: Directly merge endpoint changes
Example: Create a merge request
TIP
Both direct merge and merge requests merge only the explicitly provided resource list. They do not automatically include referenced resources or directory resources. When defining the merge scope, confirm dependencies among endpoints, directories, data models, response components, and test resources.

Archive and Delete an AI Branch#

After an AI Branch is merged or no longer needed, you can archive it first and then delete it. Before deletion, confirm that the changes in the branch have been merged or are no longer required.
CommandDescriptionExample
branch archive --type aiArchive an AI Branch.apidog branch archive <aiBranchName> --project <projectId> --type ai
branch delete --type aiDelete an archived AI Branch.apidog branch delete <aiBranchName> --project <projectId> --type ai

External AI Edit Permissions#

By default, the CLI recommends writing project resources through AI Branch. This allows AI-generated changes to enter an isolated branch first and be merged only after user confirmation.
If you want external AI or CLI operations to directly edit the main branch, standard sprint branches, or general branches, enable the corresponding permissions in the client:
Project Settings - Feature Settings - AI Feature Settings - External AI Edit Permissions
These switches control the direct write scope of external AI, CLI, or automation calls across project branches. Before enabling them, confirm your team's collaboration rules and project data security requirements.
PermissionDescription
Main branch direct edit permissionAllows external AI or CLI operations to directly write to the main branch.
Standard sprint branch direct edit permissionAllows external AI or CLI operations to directly write to standard sprint branches.
General branch direct edit permissionAllows external AI or CLI operations to directly write to general branches.
AI Branch direct edit permissionAllows external AI or CLI operations to write to AI Branches created and maintained by AI. This is usually kept enabled.
TIP
To protect project resources, we recommend having external AI or CLI operations write to an AI Branch first and merge only after user confirmation. Enable direct edit permissions only when an automation workflow clearly needs to modify the target branch directly.

Best Practices#

1.
Create one AI Branch per task: Each AI Branch should correspond to a clear task, such as completing the user registration API, organizing order module documentation, or generating payment test scenarios.
2.
Import before editing: When modifying existing resources, use pick-to to import them first, then update them in the AI Branch to avoid confusion about the source.
3.
Preview differences before merging: Use merge-request preview or the client diff view to confirm resource content and dependencies.
4.
Explicitly select the merge scope: Merge commands process only the provided resource list. For related resources such as API directories, data models, response components, and test cases, confirm them together.
5.
Keep human review: AI-generated API definitions, test scripts, and data models should be reviewed by project members before merging.
6.
Archive branches promptly: AI Branches that have been merged or abandoned should be archived promptly to keep the branch list clear.

FAQ#

What is the difference between an AI Branch and a standard sprint branch?
AI Branch is a special sprint branch mainly used to store write results from external AI, CLI operations, or automation scripts. It records the source branch and encourages users to confirm differences before merging. Standard sprint branches are usually used for day-to-day collaboration among team members.
Does an AI Branch directly affect the main branch?
No. Changes in an AI Branch are saved in that AI Branch first. Related resources enter the target branch only after a user performs a direct merge or creates and approves a merge request.
How can the CLI skip AI Branch and directly edit project data?
In an Apidog project, go to Project Settings - Feature Settings - AI Feature Settings - External AI Edit Permissions, then enable direct edit permissions for the main branch, standard sprint branches, or general branches as needed. After these permissions are enabled, external AI or CLI operations can directly write within the corresponding branch scope.
Are referenced resources automatically included when merging an AI Branch?
No. Both branch merge and merge-request create are executed according to the explicitly provided resource list. If endpoints reference data models, response components, directories, or test resources, confirm and add the corresponding resource scope before merging.
Must an AI Branch be deleted after changes are complete?
No. Deletion is not mandatory. We recommend archiving the branch after confirming that its changes have been merged or are no longer needed, and then deciding whether to delete it according to your team's conventions to avoid long-term accumulation of historical branches.
Modified atΒ 2026-06-03 05:52:07
Previous
Managing Sprint Branches
Next
Overview
Built with