Apidog Docs
🇺🇸 English
  • 🇺🇸 English
  • 🇯🇵 日本語
  • 🇪🇸 Español
  • 🇰🇷 한국인
  • 🇨🇳 简体中文
  • 🇵🇹 Português (Portugal)
  • 🇮🇩 Bahasa Indonesia
  • 🇧🇷 Português (Brasil)
  • 🇻🇳 Tiếng Việt
  • 🇨🇳 繁體中文
🇺🇸 English
  • 🇺🇸 English
  • 🇯🇵 日本語
  • 🇪🇸 Español
  • 🇰🇷 한국인
  • 🇨🇳 简体中文
  • 🇵🇹 Português (Portugal)
  • 🇮🇩 Bahasa Indonesia
  • 🇧🇷 Português (Brasil)
  • 🇻🇳 Tiếng Việt
  • 🇨🇳 繁體中文
🇺🇸 English
  • 🇺🇸 English
  • 🇯🇵 日本語
  • 🇪🇸 Español
  • 🇰🇷 한국인
  • 🇨🇳 简体中文
  • 🇵🇹 Português (Portugal)
  • 🇮🇩 Bahasa Indonesia
  • 🇧🇷 Português (Brasil)
  • 🇻🇳 Tiếng Việt
  • 🇨🇳 繁體中文
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
  1. Apidog CLI
  • 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
      • Notification Settings
      • Managing Project Members
      • 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. Apidog CLI

Apidog CLI Options

Apidog CLI is used to run automated tests and manage Apidog project resources from a terminal or CI/CD pipeline. It supports test execution, API design resource management, environments and variables, import and export, documentation publishing, branch collaboration, and project administration.

Basic Apidog CLI Syntax#

Most project resource commands use --project <projectId> to specify the project. You can use --branch <branchName> to operate on a specific branch. If --branch is omitted, the server uses the default branch.

Authentication#

Before accessing private projects, log in or provide an access token.
CommandDescriptionExample
loginLog in with an access token and save it locally.apidog login --with-token <token>
logoutLog out and clear the saved local token.apidog logout
whoamiShow information about the current authenticated user.apidog whoami
You can also pass a token directly when running commands:
If you're using GitHub Actions, you can store your access token under your repository's Settings --> Secrets and Variables --> Actions --> Repository variables. Then use ${{ vars.APIDOG_ACCESS_TOKEN }} to reference it.

CLI Schema#

Use cli-schema to inspect and validate JSON files before creating or updating complex resources. This helps reduce request failures caused by malformed data.
CommandDescriptionExample
cli-schema listList all schema keys supported by the CLI.apidog cli-schema list
cli-schema getPrint the JSON Schema for a command data file.apidog cli-schema get endpoint-create
cli-schema validateValidate a local JSON file against a schema key.apidog cli-schema validate endpoint-create --file ./endpoint.json
Schema keys usually combine the command path and action, such as endpoint-create, test-scenario-update, and merge-request-create.

Teams and Projects#

Team and project commands are the starting point for managing resources through the CLI. Use them to find the IDs required by project-level commands.

Team Management#

CommandDescriptionExample
team listList teams accessible to the current account.apidog team list
team getView details of a specific team.apidog team get <teamId>

Project Management#

CommandDescriptionExample
project listList projects accessible to the current account.apidog project list
project getView project details.apidog project get <projectId>
project createCreate a project under a team.apidog project create --team <teamId> --name "New Project"

Project Settings#

CommandDescriptionExample
project settings getView project-level settings.apidog project settings get --project <projectId>
project settings updateUpdate project settings with a JSON file.apidog project settings update --project <projectId> --file ./project-settings.json
cli-schema get project-settings-updateView the schema for project settings updates.apidog cli-schema get project-settings-update

Environments and Variables#

Use these commands to manage runtime environments, global variables, and team variables used by API debugging and automated tests.

Environment Management#

CommandDescriptionExample
environment listList environments in a project.apidog environment list --project <projectId>
environment getView environment details, such as base URLs.apidog environment get <environmentId> --project <projectId>
environment createCreate an environment.apidog environment create <name> --project <projectId> --base-url <url>
environment updateUpdate an environment.apidog environment update <environmentId> --project <projectId> --file ./environment.json
environment deleteDelete an environment.apidog environment delete <environmentId> --project <projectId>
cli-schema get environment-updateView the schema for environment updates.apidog cli-schema get environment-update

Variable Management#

CommandDescriptionExample
variables listList variables by scope.apidog variables list --project <projectId> --scope global
variables getView the value of a variable.apidog variables get --project <projectId> --scope global --key <key>
variables setCreate or update a variable.apidog variables set --project <projectId> --scope global --key <key> --value <value>
variables deleteDelete a variable.apidog variables delete --project <projectId> --scope global --key <key>
variables importImport variables from a local file.apidog variables import --project <projectId> --scope global --file ./variables.json
variables exportExport variables to a local file.apidog variables export --project <projectId> --scope global --output ./variables.json

API Design Resources#

Use these commands to manage API design resources, including HTTP API endpoints, schemas, folders, mock rules, common parameters, response components, and security schemes. When creating or updating complex resources, it is recommended to run cli-schema get <schemaKey> and cli-schema validate <schemaKey> --file <path> first.

HTTP API Endpoints#

CommandDescriptionExample
endpoint listList HTTP API endpoints in a project.apidog endpoint list --project <projectId>
endpoint getView endpoint details.apidog endpoint get <endpointId> --project <projectId>
endpoint createCreate an endpoint from a JSON file.apidog endpoint create --project <projectId> --file ./endpoint.json
endpoint updateUpdate an endpoint.apidog endpoint update <endpointId> --project <projectId> --file ./endpoint.json
endpoint deleteDelete an endpoint.apidog endpoint delete <endpointId> --project <projectId>
cli-schema get endpoint-createView the schema for endpoint creation.apidog cli-schema get endpoint-create
cli-schema get endpoint-updateView the schema for endpoint updates.apidog cli-schema get endpoint-update

Data Schemas#

CommandDescriptionExample
schema listList data schemas in a project.apidog schema list --project <projectId>
schema getView schema details.apidog schema get <schemaId> --project <projectId>
schema createCreate a data schema from a JSON file.apidog schema create --project <projectId> --file ./schema.json
schema updateUpdate a data schema.apidog schema update <schemaId> --project <projectId> --file ./schema.json
schema deleteDelete a data schema.apidog schema delete <schemaId> --project <projectId>
cli-schema get schema-createView the schema for data schema creation.apidog cli-schema get schema-create
cli-schema get schema-updateView the schema for data schema updates.apidog cli-schema get schema-update

Markdown Documents#

CommandDescriptionExample
doc listList Markdown documents.apidog doc list --project <projectId>
doc getView Markdown document details.apidog doc get <docId> --project <projectId>
doc createCreate a Markdown document.apidog doc create --project <projectId> --file ./doc.json
doc updateUpdate a Markdown document.apidog doc update <docId> --project <projectId> --file ./doc.json
doc deleteDelete a Markdown document.apidog doc delete <docId> --project <projectId>

Resource Folders#

Use folder commands to manage folder trees for different resource types. The --type option selects the resource type, such as endpoint, schema, test-scenario, response-component, security-scheme, test-suite, or test-data.
CommandDescriptionExample
folder listList folders by resource type.apidog folder list --project <projectId> --type endpoint
folder createCreate a folder by resource type.apidog folder create --project <projectId> --type endpoint --name "New Folder"
folder moveMove a folder to another parent folder.apidog folder move <folderId> --project <projectId> --type endpoint --parent <parentId>
folder updateUpdate folder name, description, or parent.apidog folder update <folderId> --project <projectId> --type endpoint --name "New Folder Name"
folder deleteDelete a folder.apidog folder delete <folderId> --project <projectId> --type endpoint
cli-schema get folder-createView the schema for folder creation.apidog cli-schema get folder-create
cli-schema get folder-updateView the schema for folder updates.apidog cli-schema get folder-update
--type selects the resource folder type. It is not the folder name. The description field is supported only for endpoint and test-scenario folders; other folder types support name and parent updates only.

Mock Rules#

CommandDescriptionExample
mock listList mock rules in a project or under an endpoint.apidog mock list --project <projectId> --http-api-id <endpointId>
mock getView a mock rule.apidog mock get <mockId> --project <projectId>
mock createCreate a mock rule from a JSON file.apidog mock create --project <projectId> --file ./mock.json
mock updateUpdate a mock rule.apidog mock update <mockId> --project <projectId> --file ./mock.json
mock deleteDelete a mock rule.apidog mock delete <mockId> --project <projectId>
cli-schema get mock-createView the schema for mock rule creation.apidog cli-schema get mock-create
cli-schema get mock-updateView the schema for mock rule updates.apidog cli-schema get mock-update

Common Parameters#

CommandDescriptionExample
common-parameter listList reusable common parameters.apidog common-parameter list --project <projectId>
common-parameter getView common parameter details.apidog common-parameter get <commonParameterId> --project <projectId>
common-parameter createCreate a common parameter from a JSON file.apidog common-parameter create --project <projectId> --file ./common-parameter.json
common-parameter updateUpdate a common parameter.apidog common-parameter update <commonParameterId> --project <projectId> --file ./common-parameter.json
common-parameter importImport common parameters from a file.apidog common-parameter import --project <projectId> --file ./common-parameters.json
common-parameter exportExport common parameters to a local file.apidog common-parameter export --project <projectId> --output ./common-parameters.json

Response Components#

CommandDescriptionExample
response-component listList reusable response components.apidog response-component list --project <projectId>
response-component getView response component details.apidog response-component get <responseComponentId> --project <projectId>
response-component createCreate a response component from a JSON file.apidog response-component create --project <projectId> --file ./response-component.json
response-component updateUpdate a response component.apidog response-component update <responseComponentId> --project <projectId> --file ./response-component.json
response-component deleteDelete a response component.apidog response-component delete <responseComponentId> --project <projectId>

Security Schemes#

CommandDescriptionExample
security-scheme listList security schemes in a project.apidog security-scheme list --project <projectId>
security-scheme getView security scheme details.apidog security-scheme get <schemeId> --project <projectId>
security-scheme createCreate a security scheme from a JSON file.apidog security-scheme create --project <projectId> --file ./scheme.json
security-scheme updateUpdate a security scheme.apidog security-scheme update <schemeId> --project <projectId> --file ./scheme.json
security-scheme deleteDelete a security scheme.apidog security-scheme delete <schemeId> --project <projectId>
API paths are API resource paths, not local file paths. If your shell rewrites values that start with /, wrap the path in quotes, for example --path '/api/users', or use --file to provide endpoint data.
For API test cases or test scenario HTTP steps, responseId should use an endpoint response definition ID from endpoint.responses[].id, not a response component ID. To reuse a response component, link it in the endpoint response definition first.

Automated Testing#

Use these commands to manage API test cases, test scenarios, test suites, test data, test reports, runners, and scheduled tasks.

API Test Cases#

CommandDescriptionExample
test-case listList API test cases, optionally filtered by endpoint.apidog test-case list --project <projectId> --endpoint <endpointId>
test-case categoryList test case categories.apidog test-case category --project <projectId>
test-case getView API test case details.apidog test-case get <caseId> --project <projectId>
test-case createCreate an API test case from a JSON file.apidog test-case create --project <projectId> --file ./case.json
test-case updateUpdate an API test case.apidog test-case update <caseId> --project <projectId> --file ./case.json
test-case deleteDelete an API test case.apidog test-case delete <caseId> --project <projectId>
cli-schema get test-case-createView the schema for test case creation.apidog cli-schema get test-case-create
cli-schema get test-case-updateView the schema for test case updates.apidog cli-schema get test-case-update

Test Scenarios#

CommandDescriptionExample
test-scenario listList test scenarios in a project.apidog test-scenario list --project <projectId>
test-scenario getView test scenario details.apidog test-scenario get <scenarioId> --project <projectId>
test-scenario createCreate a test scenario.apidog test-scenario create --project <projectId> --file ./scenario.json
test-scenario updateUpdate a test scenario.apidog test-scenario update <scenarioId> --project <projectId> --file ./scenario.json
test-scenario deleteDelete a test scenario.apidog test-scenario delete <scenarioId> --project <projectId>
test-scenario runRun a test scenario.apidog test-scenario run <scenarioId> --project <projectId> --environment <environmentId>
cli-schema get test-scenario-createView the schema for test scenario creation.apidog cli-schema get test-scenario-create
cli-schema get test-scenario-updateView the schema for test scenario updates.apidog cli-schema get test-scenario-update

Test Suites#

CommandDescriptionExample
test-suite listList test suites in a project.apidog test-suite list --project <projectId>
test-suite getView test suite details.apidog test-suite get <testSuiteId> --project <projectId>
test-suite createCreate a test suite.apidog test-suite create --project <projectId> --file ./suite.json
test-suite updateUpdate a test suite.apidog test-suite update <testSuiteId> --project <projectId> --file ./suite.json
test-suite deleteDelete a test suite.apidog test-suite delete <testSuiteId> --project <projectId>
test-suite runRun a test suite.apidog test-suite run <testSuiteId> --project <projectId> --environment <environmentId>

Test Data#

CommandDescriptionExample
test-data listList test data sets.apidog test-data list --project <projectId>
test-data getView test data set details.apidog test-data get <dataId> --project <projectId>
test-data createCreate a test data set from a JSON file.apidog test-data create --project <projectId> --file ./test-data.json
test-data updateUpdate a test data set.apidog test-data update <dataId> --project <projectId> --file ./test-data.json
test-data deleteDelete a test data set.apidog test-data delete <dataId> --project <projectId>

Test Reports#

CommandDescriptionExample
test-report listList test reports in a project.apidog test-report list --project <projectId>
test-report getView test report details.apidog test-report get <reportId> --project <projectId>
test-report downloadDownload a test report to a local file.apidog test-report download <reportId> --project <projectId> --format json --output ./report.json
test-report deleteDelete a test report.apidog test-report delete <reportId> --project <projectId>

Runners#

CommandDescriptionExample
runner listList runners in a project or team.apidog runner list --project <projectId>
runner getView runner details.apidog runner get <runnerId> --project <projectId>
runner createCreate a team runner.apidog runner create --team <teamId> --name <name> --runner-type <runnerType> --server-type <serverType>
runner checkCheck runner health.apidog runner check <runnerId> --team <teamId>
runner deleteDelete a runner.apidog runner delete <runnerId> --project <projectId>

Scheduled Tasks#

CommandDescriptionExample
scheduled-task listList scheduled tasks in a project.apidog scheduled-task list --project <projectId>
scheduled-task getView scheduled task details.apidog scheduled-task get <taskId> --project <projectId>
scheduled-task createCreate a scheduled task from a JSON file.apidog scheduled-task create --project <projectId> --file ./scheduled-task.json
scheduled-task updateUpdate a scheduled task.apidog scheduled-task update <taskId> --project <projectId> --file ./scheduled-task.json
scheduled-task deleteDelete a scheduled task.apidog scheduled-task delete <taskId> --project <projectId>
scheduled-task runTrigger a scheduled task manually.apidog scheduled-task run <taskId> --project <projectId>

Core Run Command: apidog run#

This is the main command for running test scenarios, test scenario folders, test suites, or local exported files. You can copy generated commands from the Apidog client CI/CD panel and run them in your terminal or CI/CD workflow.

Online Execution#

When running real-time tests through the Apidog server, use the following command.
Use the Apidog access token along with the ID of a specific test scenario, test scenario directory, or test suite. For example:

Local Execution#

When running offline tests using exported files, use the following command.
Specify the URL or file path of the Apidog test scenario. For example:

Run Options#

OptionDescription
--access-token <accessToken>Set authentication token for online execution
-t, --test-scenario <testScenarioId>Specify test scenario ID to run
-f, --test-scenario-folder <folderId>Specify test scenario directory ID to run
--test-suite <testSuiteId>Specify test suite ID to run
--project <projectId>Specify project ID
--branch <branchName>Specify the branch name; if omitted, the server defaults to the main branch
-r, --reporters [reporters]Specify test report types (default: ["cli"])
--out-dir <outDir>Output directory for test reports (default: ./apidog-reports)
--out-file <outFile>Output test report file name with no need to add a file extension. You can use {FOLDER_NAME}, {SCENARIO_NAME}, and {GENERATE_TIME}
--out-json-failures-separated <outJsonFailuresSeparated>Export failures as separate JSON file
-e, --environment <environmentId>Specify runtime environment
-n, --iteration-count <n>Set number of iterations
-d, --iteration-data <path>Set data for case iterations (JSON or CSV)
--on-error <behavior>Set error handling behavior (ignore, continue, or end)
--variables <path>Load environment or global variables from a local file
--global-var <value>Set global variables (key=value format)
--env-var <value>Set environment variables (key=value format)
--notification <ids>Send notifications after the run finishes
--notification-failed-event <ids>Send notifications only when the run fails
--external-program-path <path>Specify file path for external programs
--database-connection <path>Specify file path for database configuration
--ignore-redirectsPrevent automatic redirects
--silentPrevent console output
--color <value>Enable or disable colored console output
--delay-request [n]Specify delay between requests (ms)
--timeout-request [n]Specify request timeout (ms)
--timeout-script [n]Specify script execution timeout (ms)
-k, --insecureDisable SSL verification
--ssl-client-cert-list <path>Specify client certificate config path
--ssl-client-cert <path>Specify client certificate path (PEM)
--ssl-client-key <path>Specify client certificate private key path
--ssl-client-passphrase <passphrase>Specify client certificate passphrase
--ssl-extra-ca-certs <path>Specify additional trusted CA certificates
-b, --bigintEnable bigint compatibility
--upload-report [value]Upload test report overview to cloud
--preferred-http-version <preferredHttpVersion>Set preferred HTTP protocol version
--verboseDisplay detailed request and response information
--lang <language>Set CLI language (en)
-h, --helpDisplay help information
When creating or updating complex test resources such as test scenarios, test suites, test cases, test data, or scheduled tasks, use cli-schema get <schemaKey> first, then validate your local file with cli-schema validate <schemaKey> --file <path>.

Import and Export#

Use import and export commands to bring external API documents into Apidog or export project data to formats used by other tools.

Import Project Data#

The import command imports a local file into a project. Supported formats include openapi, postman, har, insomnia, jmeter, wsdl, yapi, rap2, apidoc, hoppscotch, markdown, jsonschema, and apidog.
CommandDescriptionExample
importImport a local file into a project by format.apidog import --project <projectId> --format openapi --file ./openapi.json

Auto Import Settings#

Use import auto-import to maintain auto import settings for long-term synchronization from external sources.
CommandDescriptionExample
import auto-import listList auto import settings in a project.apidog import auto-import list --project <projectId>
import auto-import createCreate an auto import setting.apidog import auto-import create --project <projectId> --file ./auto-import.json
import auto-import getView an auto import setting.apidog import auto-import get <settingId> --project <projectId>
import auto-import deleteDelete an auto import setting.apidog import auto-import delete <settingId> --project <projectId>
cli-schema get import-auto-import-createView the schema for auto import settings.apidog cli-schema get import-auto-import-create

Export Project Data#

The export command exports project data to a local file. Supported formats include openapi, markdown, html, postman, and apidog.
For native apidog export, scope supports all, apis, and tags. Folder scope is available for OpenAPI export only.
CommandDescriptionExample
exportExport project data by format.apidog export --project <projectId> --format openapi --output ./openapi.json
export --format apidogExport native project data.apidog export --project <projectId> --format apidog --output ./project.apidog.json
export --scope apisExport selected APIs in native format.apidog export --project <projectId> --format apidog --scope apis --api-ids 1001,1002 --output ./selected.apidog.json
export --scope tagsExport APIs by tags in native format.apidog export --project <projectId> --format apidog --scope tags --include-tags pet,store --output ./tagged.apidog.json
export --format openapi --scope foldersExport selected folders in OpenAPI format.apidog export --project <projectId> --format openapi --scope folders --folder-ids 2001 --output ./openapi.json

OAS Export Settings#

Use export settings to maintain reusable OAS export settings.
CommandDescriptionExample
export settings listList OAS export settings.apidog export settings list --project <projectId>
export settings createCreate an OAS export setting.apidog export settings create --project <projectId> --file ./export-setting.json
export settings getView an OAS export setting.apidog export settings get <settingId> --project <projectId>
export settings updateUpdate an OAS export setting.apidog export settings update <settingId> --project <projectId> --file ./export-setting.json
export settings deleteDelete an OAS export setting.apidog export settings delete <settingId> --project <projectId>
cli-schema get export-settings-createView the schema for OAS export setting creation.apidog cli-schema get export-settings-create
cli-schema get export-settings-updateView the schema for OAS export setting updates.apidog cli-schema get export-settings-update

Documentation Sharing#

Use these commands to publish and share API documentation.

Documentation Sites#

CommandDescriptionExample
docs-site listList documentation sites.apidog docs-site list --project <projectId>
docs-site getView documentation site details.apidog docs-site get <siteId> --project <projectId>
docs-site createCreate a documentation site.apidog docs-site create --project <projectId> --file ./docs-site.json
docs-site updateUpdate documentation site settings.apidog docs-site update <siteId> --project <projectId> --file ./docs-site.json
docs-site deleteDelete a documentation site.apidog docs-site delete <siteId> --project <projectId>

Shared Documents#

CommandDescriptionExample
shared-doc listList shared documents.apidog shared-doc list --project <projectId>
shared-doc getView shared document details.apidog shared-doc get <docId> --project <projectId>
shared-doc createCreate a shared document.apidog shared-doc create --project <projectId> --file ./shared-doc.json
shared-doc updateUpdate shared document settings.apidog shared-doc update <docId> --project <projectId> --file ./shared-doc.json
shared-doc deleteDelete a shared document.apidog shared-doc delete <docId> --project <projectId>

Branch Management#

Use branch commands to isolate changes, collaborate on project resources, and merge selected resources between branches.

Iteration Branches#

CommandDescriptionExample
branch list --type allList all branch types in a project.apidog branch list --project <projectId> --type all
branch list --type sprintList iteration branches.apidog branch list --project <projectId> --type sprint
branch get --type sprintView an iteration branch.apidog branch get <branchName> --project <projectId> --type sprint
branch create --type sprintCreate an iteration branch.apidog branch create --project <projectId> --type sprint --name <branchName> --from main
branch update --type sprintUpdate an iteration branch.apidog branch update <branchName> --project <projectId> --type sprint --name <newName>
branch mergeMerge explicitly selected resources from one branch to another.apidog branch merge --project <projectId> --from <sourceBranchName> --to <targetBranchName> --endpoint-ids <ids>
branch pick-toPick selected resources from a source branch to a target branch.apidog branch pick-to --project <projectId> --from <sourceBranchName> --to <targetBranchName> --endpoint-ids <ids>
branch archive --type sprintArchive an iteration branch before deletion.apidog branch archive <branchName> --project <projectId> --type sprint
branch delete --type sprintDelete an archived iteration branch.apidog branch delete <branchName> --project <projectId> --type sprint

AI Branches#

CommandDescriptionExample
branch list --type aiList AI branches.apidog branch list --project <projectId> --type ai
branch get --type aiView an AI branch.apidog branch get <branchName> --project <projectId> --type ai
branch create --type aiCreate an AI branch from a source branch.apidog branch create --project <projectId> --type ai --name <aiBranchName> --from <sourceBranchName>
branch update --type aiUpdate an AI branch.apidog branch update <branchName> --project <projectId> --type ai --name <newName>
branch archive --type aiArchive an AI branch before deletion.apidog branch archive <branchName> --project <projectId> --type ai
branch delete --type aiDelete an archived AI branch.apidog branch delete <branchName> --project <projectId> --type ai

General Branches#

CommandDescriptionExample
branch list --type generalList general branches.apidog branch list --project <projectId> --type general
branch get --type generalView a general branch.apidog branch get <branchName> --project <projectId> --type general
branch create --type generalCreate a general branch.apidog branch create --project <projectId> --type general --name <branchName> --from main
branch update --type generalUpdate a general branch.apidog branch update <branchName> --project <projectId> --type general --name <newName>
branch delete --type generalDelete a general branch.apidog branch delete <branchName> --project <projectId> --type general
Branch creation commands mainly use command-line options such as --type, --name, and --from. cli-schema get branch-*-create is used to inspect the create option structure. For the actual command options, run apidog branch create -h.

Merge Requests#

Use merge-request when the target branch requires a review flow. Merge requests and direct merges only merge explicitly selected resources.
CommandDescriptionExample
merge-request previewScan candidate changes before creating a merge request or direct merge.apidog merge-request preview --project <projectId> --from <sourceBranchName> --to <targetBranchName>
merge-request listList merge requests.apidog merge-request list --project <projectId> --to <targetBranchName>
merge-request getView merge request details.apidog merge-request get <mergeRequestId> --project <projectId> --to <targetBranchName>
merge-request createCreate a merge request.apidog merge-request create --project <projectId> --to <targetBranchName> --from <sourceBranchName> --reviewer-ids <userIds> --endpoint-ids <ids>
merge-request updateUpdate a merge request.apidog merge-request update <mergeRequestId> --project <projectId> --to <targetBranchName> --file ./merge-request.json
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>
merge-request deleteDelete a merge request.apidog merge-request delete <mergeRequestId> --project <projectId> --to <targetBranchName>
To keep project resources safe, CLI write permissions may be restricted by default. You can edit source branch data through an AI branch, or enable external editing permissions in project feature settings when direct editing is required for the main branch, standard iteration branches, or general branches. Changes made on an AI branch still need user confirmation before merge or merge-request.
AI branch names are recommended to include the date, source branch, and purpose, for example ai/20260312-from-main-user-register.
For branch merge and pick operations, resource ID options use plural names and comma-separated numeric IDs, such as --endpoint-ids 1,2, --doc-ids 3,4, and --test-suite-ids 5,6.

Other Resources#

Use these commands to manage project extension resources and external connections.

Custom Fields#

CommandDescriptionExample
custom-field listList custom fields.apidog custom-field list --project <projectId>
custom-field createCreate a custom field.apidog custom-field create --project <projectId> --file ./custom-field.json
custom-field updateUpdate a custom field.apidog custom-field update <customFieldId> --project <projectId> --file ./custom-field.json
custom-field deleteDelete a custom field.apidog custom-field delete <customFieldId> --project <projectId>

WebSocket APIs#

CommandDescriptionExample
websocket listList WebSocket APIs.apidog websocket list --project <projectId>
websocket getView WebSocket API details.apidog websocket get <websocketId> --project <projectId>
websocket createCreate a WebSocket API.apidog websocket create --project <projectId> --name <name> --url <url>
websocket updateUpdate a WebSocket API.apidog websocket update <websocketId> --project <projectId> --file ./websocket.json
websocket deleteDelete a WebSocket API.apidog websocket delete <websocketId> --project <projectId>

Socket.IO APIs#

CommandDescriptionExample
socketio listList Socket.IO APIs.apidog socketio list --project <projectId>
socketio getView Socket.IO API details.apidog socketio get <socketioId> --project <projectId>
socketio createCreate a Socket.IO API.apidog socketio create --project <projectId> --file ./socketio.json
socketio updateUpdate a Socket.IO API.apidog socketio update <socketioId> --project <projectId> --file ./socketio.json
socketio deleteDelete a Socket.IO API.apidog socketio delete <socketioId> --project <projectId>

Common Scripts#

CommandDescriptionExample
common-script listList common scripts.apidog common-script list --project <projectId>
common-script getView common script details.apidog common-script get <scriptId> --project <projectId>
common-script createCreate a common script.apidog common-script create --project <projectId> --file ./common-script.json
common-script updateUpdate a common script.apidog common-script update <scriptId> --project <projectId> --file ./common-script.json
common-script deleteDelete a common script.apidog common-script delete <scriptId> --project <projectId>

Database Connections#

CommandDescriptionExample
database-connection listList database connections.apidog database-connection list --project <projectId>
database-connection getView database connection details.apidog database-connection get <connectionId> --project <projectId>
database-connection createCreate a database connection.apidog database-connection create --project <projectId> --file ./database-connection.json
database-connection updateUpdate a database connection.apidog database-connection update <connectionId> --project <projectId> --file ./database-connection.json
database-connection deleteDelete a database connection.apidog database-connection delete <connectionId> --project <projectId>

Vault Providers#

CommandDescriptionExample
vault listList vault providers.apidog vault list --project <projectId>
vault getView vault provider details.apidog vault get <vaultProviderId> --project <projectId>
vault createCreate a vault provider.apidog vault create --project <projectId> --file ./vault.json
vault updateUpdate a vault provider.apidog vault update <vaultProviderId> --project <projectId> --file ./vault.json
vault deleteDelete a vault provider.apidog vault delete <vaultProviderId> --project <projectId>

Git Connections#

CommandDescriptionExample
git-connection listList Git connections.apidog git-connection list --project <projectId>
git-connection getView Git connection details.apidog git-connection get <connectionId> --project <projectId>
git-connection createCreate a Git connection.apidog git-connection create --project <projectId> --file ./git-connection.json
git-connection updateUpdate a Git connection.apidog git-connection update <connectionId> --project <projectId> --file ./git-connection.json
git-connection deleteDelete a Git connection.apidog git-connection delete <connectionId> --project <projectId>

Management and Settings#

Use these commands for project administration, notifications, recycle bin resources, change history, and audit logs.

Notifications#

CommandDescriptionExample
notification listList notification configurations.apidog notification list --project <projectId>
notification getView notification details.apidog notification get <notificationId> --project <projectId>
notification createCreate a notification configuration.apidog notification create --project <projectId> --file ./notification.json
notification updateUpdate a notification configuration.apidog notification update <notificationId> --project <projectId> --file ./notification.json
notification deleteDelete a notification configuration.apidog notification delete <notificationId> --project <projectId>

Recycle Bin#

CommandDescriptionExample
recycle listList resources in the recycle bin.apidog recycle list --project <projectId>
recycle restoreRestore a resource from the recycle bin.apidog recycle restore <itemId> --project <projectId>
recycle deletePermanently delete a recycle bin resource.apidog recycle delete <itemId> --project <projectId>

History#

CommandDescriptionExample
history listList project change history.apidog history list --project <projectId>
history getView change history details.apidog history get <historyId> --project <projectId>

Audit Logs#

CommandDescriptionExample
audit-log listList project audit logs.apidog audit-log list --project <projectId>
audit-log getView audit log details.apidog audit-log get <auditLogId> --project <projectId>

Advanced Usage#

Uploading Files in CLI#

When working with APIs that require file uploads, accurately setting the path of the file to be uploaded is crucial. You should store the file in the same machine where the tests run and reference it using either its absolute or relative path. Follow these steps to reference a file to upload.
1
Copy the required file to the machine running the CLI beforehand. For example, if you're using GitHub Actions as your CI/CD pipeline, copy the required file to the same GitHub repository to that of your workflow.
2
In Apidog, navigate to your test scenario and locate the step that requires file upload. Click on Bulk Edit button as shown below.
Batch Edit button in test scenario step details
3
Copy the path of the file you copied to the CLI machine. Then replace the file field parameter value with the file path on the CLI machine. For example, if you put a png file under data folder in a GitHub repo, you can use data/to-be-uploaded.png to reference it.
File path configuration in batch edit mode
After this configuration, the file can be correctly sent to Apidog through the CLI.
If you want to run this test scenario locally again, you'll need to modify the file path in the parameter value back to the path on your local machine.

Using Database Operations in CLI#

When your test scenarios include database operations, you need to take a few extra steps because database configurations are saved locally, not in the cloud. This means you can't directly run the CLI in cloud mode for these scenarios. Here's how to handle this situation:
1
For test scenarios that include database operations, you'll see a prompt in the command line generation interface: "Download the database configuration file."
2
Download this file and place it in the directory where you plan to run the Apidog CLI.
3
The automatically generated command line will include the --database-connection option. You can use this command line as is to run your tests.

Uploading Local CLI Test Reports to the Cloud#

To upload your local CLI test reports to the cloud, you can add the --upload-report parameter at the end of your CLI command. Here's how to do it:
1
Add the --upload-report parameter to your CLI command:
2
This command will run your tests and automatically upload the test report to the cloud after completion.
3
To view the uploaded report:
Go to the "Test Reports" section in your Apidog dashboard.
Look for the "Team Reports" column.
4
Note: For reports uploaded via CLI, the "Tester" field will be displayed as empty.

Using External Scripts/Programs in CLI#

You can reference external scripts or programs when running the Apidog CLI by adding their path at the end of the command. Here's how to do it:
In this example, the CLI is instructed to reference programs located in the ./scripts directory. If no hierarchy is specified, the default is the current CLI execution directory.
There are two main approaches to managing these external scripts:

1. Local Path#

To avoid confusion in managing local scripts, it's recommended to:
Organize all script files by category
Place them in a specific directory
Specify the corresponding local path in the CLI command

2. Cloud Code Repository#

Alternatively, you can:
Host script files in a cloud-based code repository
Set up pull commands in your CI/CD workflow to fetch external scripts to the local environment
Specify the actual path of the external scripts in the CLI command

SSL#

Client Certificate#

Apidog CLI supports passing in client certificates.

Using Single SSL Client Certificate#

--ssl-client-cert
Specify the path of the public SSL client certificate.
--ssl-client-key
Specify the path of the private SSL client certificate (optional).
--ssl-client-passphrase
Specify SSL client passphrase (optional).

Using SSL Client Certificates Configuration File (Supports Multiple Certificates)#

--ssl-client-cert-list
Specify the path of the JSON file of the SSL client certificate list. For example: ssl-client-cert-list.json
[
    {
        "name": "domain1",
        "matches": ["https://test.domain1.com/*", "https://www.domain1/*"],
        "key": {"src": "/CI/client.domain1.key"},
        "cert": {"src": "/CI/client.domain1.crt"},
        "passphrase": "changeme"
    },
    {
        "name": "domain2",
        "matches": ["https://domain2.com/*"],
        "key": {"src": "/CI/client.domain2.key"},
        "cert": {"src": "/CI/client.domain2.crt"},
        "passphrase": "changeme"
    }
]
This option supports setting different SSL client certificates based on URL or hostname. It takes precedence over the --ssl-client-cert, --ssl-client-key, and --ssl-client-passphrase options. These options will be used as fallback options if there is no match for the URL in the list.

HTTP/2#

The CLI can be configured to use specific protocol versions for sending requests by using the --preferred-http-version parameter.
Protocol version parameter values:
1.
"HTTP/2" - HTTP/2 Application-Layer Protocol Negotiation (ALPN), supported only for HTTPS requests.
2.
"HTTP/2-with-prior-knowledge" - HTTP/2 with prior knowledge.
3.
"HTTP/1" - HTTP/1.1.
The parameter supports the following configurations:
1.
Setting different protocol versions for HTTPS and HTTP requests:
2.
Setting the same protocol version for both HTTPS and HTTP:
3.
Setting HTTP/2 for both HTTPS and HTTP (unsupported values will be automatically ignored):

FAQ#

How to handle the error message Invalid character in header content['Authorization']?
This error is usually caused by invalid characters in the Authorization header, such as non-ASCII characters, line breaks, or extra spaces. If you're certain that running test scenarios in the Apidog client or web interface doesn't produce any errors, please check whether you've set INITIAL values for variables in your environment and confirm that the Authorization value matches the expected format.
How can I edit project data directly without using an AI branch?
Project write permissions may be restricted for safety. Check the project's feature settings and enable external editing permissions when direct editing is required.
Modified at 2026-06-08 06:34:40
Previous
Installing and Running Apidog CLI
Next
Overview
Built with