---
title: "Trigger tests on deployment"
method: POST
path: "/events/deployment"
tags: ["Event"]
---

# Trigger tests on deployment

`POST /events/deployment`

Create a deployment event to trigger a parallel run of all active plans that meet specified conditions, including application, environment, and plan label. Learn more in [the docs](https://help.mabl.com/hc/en-us/articles/17780788992148).

## Query parameters

- `preview` boolean

## Request body

- DeploymentEvent — Describes a deployment event
  - `id` string — Unique ID for this event, set by mabl
  - `environment_id` string — The ID of the environment. When provided, mabl only triggers plans that contain this environment.
  - `application_id` string — The ID of the application. When provided, mabl only triggers plans that contain this application.
  - `workspace_id` string — The ID of the workspace associated with this deployment, set by mabl
  - `event_time` integer — Time at which the deployment occurred
  - `received_time` integer — Time at which the deployment event was received by the API
  - `revision` string — The source code revision associated with the deployment
  - `properties` object — Arbitrary key-value pairs used to pass additional information about this deployment
  - `target_runtime_version` string — Target execution test runner image tag to execute
  - `target_orchestration_version` string — Optional orchestration runtime version to use, if applicable. Otherwise use default orchestration version.
  - `debug` boolean — If true will capture additional debugging information during execution of triggered test runs. Support admin or feature flag required.
  - `triggered_plan_run_summaries` DeploymentPlanSummary[] — Summary of the plans that were triggered by this deployment event
    - `plan_id` string — Unique ID for this plan
    - `plan_run_id` string — The ID of run of the plan
  - `plan_overrides` PlanOverrideOptions — Overridable Plan attributes
    - `api_url` string — Optional api URL override. If not specified the api URL configured on the plan will be used
    - `browser_type` 'chrome' | 'edge' | 'firefox' | 'internet_explorer' | 'safari' — DEPRECATED - The browser that should be used when executing tests, use browser_types
    - `browser_types` string[] — The browsers to execute tests on
    - `credentials_id` string — ID of the credentials object - last portion of the URL on Settings/Credentials
    - `credentials_required` boolean — Set to true if the credentials_id is present, otherwise omit
    - `deployment_id` string — DEPRECATED - use deployment_ids - The deployment ID associated with this run policy
    - `deployment_ids` string[] — The deployment IDs associated with this run policy
    - `emulation_mode` 'desktop' | 'mobile_web' — Mobile device emulation. When mobile is specified, browser_types is ignored in favor of web_emulation_types.
    - `execution_stages` ExecutionStage[] — Describes how test should be executed
      - `name` string — Name of this stage
      - `concurrency` 'sequential' | 'parallel' — How journeys should be executed
      - `concurrency_limit` integer — The maximum number of concurrent test runs for this stage. Only used with parallel execution
      - `always_run_stage` boolean — if true this stage will always run regardless of whether previous stages have passed
      - `always_run_journeys` boolean — if true all journeys within this stage will be run even if a preceding journey has failed
      - `journeys` TestConfiguration[] — The journeys included in this stage; if concurrency is sequential they will be executed in this order
        - `journey_id` string, required
        - `parameters` ExecutionParameter[]
          - `type` 'basic_auth' | 'credentials' | 'ignore_variables' | 'value' | 'variable_row' | 'variables', required — The type of this parameter
          - `name` string — The name of this parameter
          - `value` string, required — The value of this parameter
          - `argument` string — Additional text data for this parameter.
          - `argumentObject` union — Additional data for this parameter.
            - DynamicScenarioSelection — Dynamic scenario selection parameter argument
              - …
            - StaticScenarioSelection — Static scenario selection parameter argument
              - …
      - `browser_types_override` string[]
      - `use_browser_types_override` boolean — If true, the browser types in this stage will be used instead of the browser types from the plan
      - `run_multiplier_override` integer
      - `use_run_multiplier_override` boolean — If true, the run multiplier in this stage will be used instead of the run multiplier from the plan
      - `ignore_datatables` boolean — If true, the data tables specified in the journeys in this stage will be ignored
    - `journeys` TestConfiguration[] — DEPRECATED - use execution_stages
      - `journey_id` string, required
      - `parameters` ExecutionParameter[]
        - `type` 'basic_auth' | 'credentials' | 'ignore_variables' | 'value' | 'variable_row' | 'variables', required — The type of this parameter
        - `name` string — The name of this parameter
        - `value` string, required — The value of this parameter
        - `argument` string — Additional text data for this parameter.
        - `argumentObject` union — Additional data for this parameter.
          - DynamicScenarioSelection — Dynamic scenario selection parameter argument
            - `type` 'dynamic'
            - `query` string, required — The user query prompt
            - `count` integer, required — The estimated count of scenarios
          - StaticScenarioSelection — Static scenario selection parameter argument
            - `type` 'static'
            - `scenario_ids` string[], required — The selection scenario IDs
            - `count` integer, required — The estimated count of scenarios
    - `http_auth_credentials_id` string — ID of HTTP Basic Auth credentials - last portion of the URL on Settings/Credentials
    - `http_auth_credentials_required` boolean — Set to true if http_auth_credentials_id is present, otherwise omit
    - `http_headers` HttpHeader[] — Custom HTTP headers to send with all requests
      - `name` string, required — The name of the header
      - `value` string — The value of the header
      - `log_header_value` boolean — Log the header value in the execution log, if not true only the header name is logged.
    - `http_headers_required` boolean — Flag indicating whether or not custom HTTP headers are required
    - `link_agent_label` string — DEPRECATED - use link_agent_labels
    - `link_agent_labels` string[] — Optional Link Agent Labels override for the deployment
    - `mobile_app_file_ids` object — Map of mobile platform => mobile app file ID override
    - `mobile_device_ids` string[] — Devices to use for mobile testing
    - `nodejs_runtime_variant` 'playwright' | 'puppeteer' — Override the Node.js execution runtime variant, if v2 runtime in use
    - `organization_id` string — Likely unused, added here for backward CLI client compatibility
    - `run_multiplier` integer — if > 1, will start multiple copies of each test run when this plan runs
    - `uri` string — DEPRECATED - Alias for web_url
    - `web_url` string — Optional web URL override. If not specified the web URL configured on the plan will be used
    - `send_mabl_header` boolean — Controls whether or not the x-mabl-agent header is sent on requests
    - `execution_runner_size` 'x1' | 'x2' | 'x3' | 'x4' | 'x5' | 'x6' | 'small' | 'medium' | 'large' | 'inherit' — available runner sizes
  - `plan_labels` string[] — If specified, only plans matching the given labels will execute
  - `source_control` SourceControl
    - `revision` string — the primary source revision associated with this object
    - `revisions` string[] — all source revision ids associated with this object
    - `commit_username` string — the username of the user who committed the revision associated with this object
    - `branch_name` string — the branch associated with this object
    - `branches` SourceControlBranch[] — Related branches
      - `name` string, required — repository unique branch name
      - `html_url` string, required — HTML page url to view branch tree
    - `pull_request` SourceControlPullRequest — the pull request associated with this object
      - `id` string — vendor unique pull request identifier (immutable)
      - `number` integer — the number associated with the pull request (repository unique)
      - `title` string — the title of the pull request
      - `html_url` string — HTML page url to view pull request object
    - `pull_requests` SourceControlPullRequest[] — Related pull requests
      - `id` string — vendor unique pull request identifier (immutable)
      - `number` integer — the number associated with the pull request (repository unique)
      - `title` string — the title of the pull request
      - `html_url` string — HTML page url to view pull request object
    - `authors` SourceControlAuthor[] — Related authors. Should be at least one
      - `id` string, required — vendor unique author id (invariant)
      - `user_name` string, required — author username name (mutable)
      - `name` string — author full name (mutable)
      - `email` string — author email
      - `html_url` string, required — HTML page url to view author
      - `avatar_url` string, required — author avatar image URL
      - `user_type` string — repository name unique within owner scope
    - `repository_url` string — the url of the repository associated with this object
    - `repository_name` string — the name of the repository associated with this object
    - `repository` SourceControlRepository — the SCM repository associated with this object
      - `id` string, required — vendor unique repository id (immutable)
      - `name` string, required — repository name unique within owner scope
      - `full_name` string — vendor unique name to identify this repo across all vendor's repos
      - `owner_name` string, required — repository name unique within owner scope
      - `owner` SourceControlRepositoryOwner — the SCM repository associated with this object
        - `id` string, required — vendor unique repository id (immutable)
        - `name` string, required — repository name unique within owner scope
        - `owner_type` string, required — repository name unique within owner scope
        - `html_url` string, required — HTML page url to view branch tree
        - `avatar_url` string — owner avatar image URL
      - `html_url` string, required — HTML page url to view branch tree
      - `is_public` boolean — true if repository publicly visible
      - `checkout_url` string — SCM remote checkout path
  - `source_control_tag` string — deprecated, use branch
  - `branch` string — The mabl branch to run tests from
  - `actions` DeploymentActions — Actions to give mabl for this deployment
    - `rebaseline_images` boolean — Set to true to tell mabl to rebaseline image models for all images associated with this test
    - `set_static_baseline` boolean — Set to true to tell mabl to use the images generated by this deplyment as a static baseline. This will lock the baseline to this image until a new baseline is provided.
    - `snapshot` DeploymentSnapshotAction — Tells mabl to snapshot the branch onto the environment as part of a deployment event
      - `from` string, required — The name of the branch to snapshot from. Including this will update the environment to associate it with a fixed snapshot of the given branch. If excluded, the environment will be updated to run latest from master. Only applicable if an environment is included in the deployment event.

## Response `201`

The deployment event was created

- DeploymentEvent — Describes a deployment event
  - `id` string — Unique ID for this event, set by mabl
  - `environment_id` string — The ID of the environment. When provided, mabl only triggers plans that contain this environment.
  - `application_id` string — The ID of the application. When provided, mabl only triggers plans that contain this application.
  - `workspace_id` string — The ID of the workspace associated with this deployment, set by mabl
  - `event_time` integer — Time at which the deployment occurred
  - `received_time` integer — Time at which the deployment event was received by the API
  - `revision` string — The source code revision associated with the deployment
  - `properties` object — Arbitrary key-value pairs used to pass additional information about this deployment
  - `target_runtime_version` string — Target execution test runner image tag to execute
  - `target_orchestration_version` string — Optional orchestration runtime version to use, if applicable. Otherwise use default orchestration version.
  - `debug` boolean — If true will capture additional debugging information during execution of triggered test runs. Support admin or feature flag required.
  - `triggered_plan_run_summaries` DeploymentPlanSummary[] — Summary of the plans that were triggered by this deployment event
    - `plan_id` string — Unique ID for this plan
    - `plan_run_id` string — The ID of run of the plan
  - `plan_overrides` PlanOverrideOptions — Overridable Plan attributes
    - `api_url` string — Optional api URL override. If not specified the api URL configured on the plan will be used
    - `browser_type` 'chrome' | 'edge' | 'firefox' | 'internet_explorer' | 'safari' — DEPRECATED - The browser that should be used when executing tests, use browser_types
    - `browser_types` string[] — The browsers to execute tests on
    - `credentials_id` string — ID of the credentials object - last portion of the URL on Settings/Credentials
    - `credentials_required` boolean — Set to true if the credentials_id is present, otherwise omit
    - `deployment_id` string — DEPRECATED - use deployment_ids - The deployment ID associated with this run policy
    - `deployment_ids` string[] — The deployment IDs associated with this run policy
    - `emulation_mode` 'desktop' | 'mobile_web' — Mobile device emulation. When mobile is specified, browser_types is ignored in favor of web_emulation_types.
    - `execution_stages` ExecutionStage[] — Describes how test should be executed
      - `name` string — Name of this stage
      - `concurrency` 'sequential' | 'parallel' — How journeys should be executed
      - `concurrency_limit` integer — The maximum number of concurrent test runs for this stage. Only used with parallel execution
      - `always_run_stage` boolean — if true this stage will always run regardless of whether previous stages have passed
      - `always_run_journeys` boolean — if true all journeys within this stage will be run even if a preceding journey has failed
      - `journeys` TestConfiguration[] — The journeys included in this stage; if concurrency is sequential they will be executed in this order
        - `journey_id` string, required
        - `parameters` ExecutionParameter[]
          - `type` 'basic_auth' | 'credentials' | 'ignore_variables' | 'value' | 'variable_row' | 'variables', required — The type of this parameter
          - `name` string — The name of this parameter
          - `value` string, required — The value of this parameter
          - `argument` string — Additional text data for this parameter.
          - `argumentObject` union — Additional data for this parameter.
            - DynamicScenarioSelection — Dynamic scenario selection parameter argument
              - …
            - StaticScenarioSelection — Static scenario selection parameter argument
              - …
      - `browser_types_override` string[]
      - `use_browser_types_override` boolean — If true, the browser types in this stage will be used instead of the browser types from the plan
      - `run_multiplier_override` integer
      - `use_run_multiplier_override` boolean — If true, the run multiplier in this stage will be used instead of the run multiplier from the plan
      - `ignore_datatables` boolean — If true, the data tables specified in the journeys in this stage will be ignored
    - `journeys` TestConfiguration[] — DEPRECATED - use execution_stages
      - `journey_id` string, required
      - `parameters` ExecutionParameter[]
        - `type` 'basic_auth' | 'credentials' | 'ignore_variables' | 'value' | 'variable_row' | 'variables', required — The type of this parameter
        - `name` string — The name of this parameter
        - `value` string, required — The value of this parameter
        - `argument` string — Additional text data for this parameter.
        - `argumentObject` union — Additional data for this parameter.
          - DynamicScenarioSelection — Dynamic scenario selection parameter argument
            - `type` 'dynamic'
            - `query` string, required — The user query prompt
            - `count` integer, required — The estimated count of scenarios
          - StaticScenarioSelection — Static scenario selection parameter argument
            - `type` 'static'
            - `scenario_ids` string[], required — The selection scenario IDs
            - `count` integer, required — The estimated count of scenarios
    - `http_auth_credentials_id` string — ID of HTTP Basic Auth credentials - last portion of the URL on Settings/Credentials
    - `http_auth_credentials_required` boolean — Set to true if http_auth_credentials_id is present, otherwise omit
    - `http_headers` HttpHeader[] — Custom HTTP headers to send with all requests
      - `name` string, required — The name of the header
      - `value` string — The value of the header
      - `log_header_value` boolean — Log the header value in the execution log, if not true only the header name is logged.
    - `http_headers_required` boolean — Flag indicating whether or not custom HTTP headers are required
    - `link_agent_label` string — DEPRECATED - use link_agent_labels
    - `link_agent_labels` string[] — Optional Link Agent Labels override for the deployment
    - `mobile_app_file_ids` object — Map of mobile platform => mobile app file ID override
    - `mobile_device_ids` string[] — Devices to use for mobile testing
    - `nodejs_runtime_variant` 'playwright' | 'puppeteer' — Override the Node.js execution runtime variant, if v2 runtime in use
    - `organization_id` string — Likely unused, added here for backward CLI client compatibility
    - `run_multiplier` integer — if > 1, will start multiple copies of each test run when this plan runs
    - `uri` string — DEPRECATED - Alias for web_url
    - `web_url` string — Optional web URL override. If not specified the web URL configured on the plan will be used
    - `send_mabl_header` boolean — Controls whether or not the x-mabl-agent header is sent on requests
    - `execution_runner_size` 'x1' | 'x2' | 'x3' | 'x4' | 'x5' | 'x6' | 'small' | 'medium' | 'large' | 'inherit' — available runner sizes
  - `plan_labels` string[] — If specified, only plans matching the given labels will execute
  - `source_control` SourceControl
    - `revision` string — the primary source revision associated with this object
    - `revisions` string[] — all source revision ids associated with this object
    - `commit_username` string — the username of the user who committed the revision associated with this object
    - `branch_name` string — the branch associated with this object
    - `branches` SourceControlBranch[] — Related branches
      - `name` string, required — repository unique branch name
      - `html_url` string, required — HTML page url to view branch tree
    - `pull_request` SourceControlPullRequest — the pull request associated with this object
      - `id` string — vendor unique pull request identifier (immutable)
      - `number` integer — the number associated with the pull request (repository unique)
      - `title` string — the title of the pull request
      - `html_url` string — HTML page url to view pull request object
    - `pull_requests` SourceControlPullRequest[] — Related pull requests
      - `id` string — vendor unique pull request identifier (immutable)
      - `number` integer — the number associated with the pull request (repository unique)
      - `title` string — the title of the pull request
      - `html_url` string — HTML page url to view pull request object
    - `authors` SourceControlAuthor[] — Related authors. Should be at least one
      - `id` string, required — vendor unique author id (invariant)
      - `user_name` string, required — author username name (mutable)
      - `name` string — author full name (mutable)
      - `email` string — author email
      - `html_url` string, required — HTML page url to view author
      - `avatar_url` string, required — author avatar image URL
      - `user_type` string — repository name unique within owner scope
    - `repository_url` string — the url of the repository associated with this object
    - `repository_name` string — the name of the repository associated with this object
    - `repository` SourceControlRepository — the SCM repository associated with this object
      - `id` string, required — vendor unique repository id (immutable)
      - `name` string, required — repository name unique within owner scope
      - `full_name` string — vendor unique name to identify this repo across all vendor's repos
      - `owner_name` string, required — repository name unique within owner scope
      - `owner` SourceControlRepositoryOwner — the SCM repository associated with this object
        - `id` string, required — vendor unique repository id (immutable)
        - `name` string, required — repository name unique within owner scope
        - `owner_type` string, required — repository name unique within owner scope
        - `html_url` string, required — HTML page url to view branch tree
        - `avatar_url` string — owner avatar image URL
      - `html_url` string, required — HTML page url to view branch tree
      - `is_public` boolean — true if repository publicly visible
      - `checkout_url` string — SCM remote checkout path
  - `source_control_tag` string — deprecated, use branch
  - `branch` string — The mabl branch to run tests from
  - `actions` DeploymentActions — Actions to give mabl for this deployment
    - `rebaseline_images` boolean — Set to true to tell mabl to rebaseline image models for all images associated with this test
    - `set_static_baseline` boolean — Set to true to tell mabl to use the images generated by this deplyment as a static baseline. This will lock the baseline to this image until a new baseline is provided.
    - `snapshot` DeploymentSnapshotAction — Tells mabl to snapshot the branch onto the environment as part of a deployment event
      - `from` string, required — The name of the branch to snapshot from. Including this will update the environment to associate it with a fixed snapshot of the given branch. If excluded, the environment will be updated to run latest from master. Only applicable if an environment is included in the deployment event.

## Other responses

- `400` — Invalid request
- `401` — Missing or invalid credentials
- `403` — The provided API Key is not authorized to make this call
- `404` — The provided application or environment could not be found
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
