---
title: "Edit a mobile test"
method: PUT
path: "/api/v1/synthetics/tests/mobile/{public_id}"
tags: ["Synthetics"]
---

# Edit a mobile test

`PUT /api/v1/synthetics/tests/mobile/{public_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `synthetics_write`

Edit the configuration of a Synthetic mobile test.

## Path parameters

- `public_id` string, required

## Request body

- SyntheticsMobileTest: Object containing details about a Synthetic mobile test.
  - `config` SyntheticsMobileTestConfig, required: Configuration object for a Synthetic mobile test.
    - `initialApplicationArguments` SyntheticsMobileTestInitialApplicationArguments: Initial application arguments for a mobile test.
    - `variables` SyntheticsConfigVariable[]: Array of variables used for the test steps.
      - `example` string: Example for the variable.
      - `id` string: ID of the variable for global variables.
      - `name` string, required: Name of the variable.
      - `pattern` string: Pattern of the variable.
      - `secure` boolean: Whether the value of this variable will be obfuscated in test results. Only for config variables of type `text`.
      - `type` 'global' | 'text' | 'email', required: Type of the configuration variable.
  - `device_ids` SyntheticsDeviceID[]: Array with the different device IDs used to run the test.
  - `message` string, required: Notification message associated with the test.
  - `monitor_id` integer: The associated monitor ID.
  - `name` string, required: Name of the test.
  - `options` SyntheticsMobileTestOptions, required: Object describing the extra options for a Synthetic test.
    - `allowApplicationCrash` boolean: A boolean to set if an application crash would mark the test as failed.
    - `bindings` SyntheticsTestRestrictionPolicyBinding[]: Array of bindings used for the mobile test.
      - `principals` string[]: List of principals for a mobile test binding.
      - `relation` 'editor' | 'viewer': The type of relation for the binding.
    - `ci` SyntheticsTestCiOptions: CI/CD options for a Synthetic test.
      - `executionRule` 'blocking' | 'non_blocking' | 'skipped', required: Execution rule for a Synthetic test.
    - `defaultStepTimeout` integer: The default timeout for steps in the test (in seconds).
    - `device_ids` SyntheticsDeviceID[], required: For mobile test, array with the different device IDs used to run the test.
    - `disableAutoAcceptAlert` boolean: A boolean to disable auto accepting alerts.
    - `min_failure_duration` integer: Minimum amount of time in failure required to trigger an alert.
    - `mobileApplication` SyntheticsMobileTestsMobileApplication, required: Mobile application for mobile synthetics test.
      - `applicationId` string, required: Application ID of the mobile application.
      - `referenceId` string, required: Reference ID of the mobile application.
      - `referenceType` 'latest' | 'version', required: Reference type for the mobile application for a mobile synthetics test.
    - `monitor_name` string: The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.
    - `monitor_options` SyntheticsTestOptionsMonitorOptions: Object containing the options for a Synthetic test as a monitor (for example, renotification).
      - `escalation_message` string: Message to include in the escalation notification.
      - `notification_preset_name` 'show_all' | 'hide_all' | 'hide_query' | 'hide_handles' | 'hide_query_and_handles' | 'show_only_snapshot' | 'hide_handles_and_footer': The name of the preset for the notification for the monitor.
      - `renotify_interval` integer: Time interval before renotifying if the test is still failing (in minutes).
      - `renotify_occurrences` integer: The number of times to renotify if the test is still failing.
    - `monitor_priority` integer: Integer from 1 (high) to 5 (low) indicating alert severity.
    - `noScreenshot` boolean: A boolean set to not take a screenshot for the step.
    - `restricted_roles` string[]: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
    - `retry` SyntheticsTestOptionsRetry: Object describing the retry strategy to apply to a Synthetic test.
      - `count` integer: Number of times a test needs to be retried before marking a location as failed. Defaults to 0.
      - `interval` number, double: Time interval between retries (in milliseconds). Defaults to 300ms.
    - `scheduling` SyntheticsTestOptionsScheduling: Object containing timeframes and timezone used for advanced scheduling.
      - `timeframes` SyntheticsTestOptionsSchedulingTimeframe[], required: Array containing objects describing the scheduling pattern to apply to each day.
        - `day` integer, required: Number representing the day of the week.
        - `from` string, required: The hour of the day on which scheduling starts.
        - `to` string, required: The hour of the day on which scheduling ends.
      - `timezone` string, required: Timezone in which the timeframe is based.
    - `tick_every` integer, required: The frequency at which to run the Synthetic test (in seconds).
    - `verbosity` integer: The level of verbosity for the mobile test. This field can not be set by a user.
  - `public_id` string: The public ID of the test.
  - `status` 'live' | 'paused': Define whether you want to start (`live`) or pause (`paused`) a Synthetic test.
  - `steps` SyntheticsMobileStep[]: Array of steps for the test.
    - `allowFailure` boolean: A boolean set to allow this step to fail.
    - `hasNewStepElement` boolean: A boolean set to determine if the step has a new step element.
    - `isCritical` boolean: A boolean to use in addition to `allowFailure` to determine if the test should be marked as failed when the step fails.
    - `name` string, required: The name of the step.
    - `noScreenshot` boolean: A boolean set to not take a screenshot for the step.
    - `params` SyntheticsMobileStepParams, required: The parameters of a mobile step.
      - `check` 'equals' | 'notEquals' | 'contains' | 'notContains' | 'startsWith' | 'notStartsWith' | 'greater' | 'lower' | 'greaterEquals' | 'lowerEquals' | 'matchRegex' | 'between' | 'isEmpty' | 'notIsEmpty': Type of assertion to apply in an API test.
      - `delay` integer: Number of milliseconds to wait between inputs in a `typeText` step type.
      - `direction` 'up' | 'down' | 'left' | 'right': The direction of the scroll for a `scrollToElement` step type.
      - `element` SyntheticsMobileStepParamsElement: Information about the element used for a step.
        - `context` string: Context of the element.
        - `contextType` 'native' | 'web': Type of the context that the element is in.
        - `elementDescription` string: Description of the element.
        - `multiLocator` object: Multi-locator to find the element.
        - `relativePosition` SyntheticsMobileStepParamsElementRelativePosition: Position of the action relative to the element.
          - `x` number, double: The `relativePosition` on the `x` axis for the element.
          - `y` number, double: The `relativePosition` on the `y` axis for the element.
        - `textContent` string: Text content of the element.
        - `userLocator` SyntheticsMobileStepParamsElementUserLocator: User locator to find the element.
          - `failTestOnCannotLocate` boolean: Whether if the test should fail if the element cannot be found.
          - `values` SyntheticsMobileStepParamsElementUserLocatorValuesItems[]: Values of the user locator.
            - `type` 'accessibility-id' | 'id' | 'ios-predicate-string' | 'ios-class-chain' | 'xpath': Type of a user locator.
            - `value` string: Value of a user locator.
        - `viewName` string: Name of the view of the element.
      - `enabled` boolean: Boolean to change the state of the wifi for a `toggleWiFi` step type.
      - `maxScrolls` integer: Maximum number of scrolls to do for a `scrollToElement` step type.
      - `positions` SyntheticsMobileStepParamsPositionsItems[]: List of positions for the `flick` step type. The maximum is 10 flicks per step
        - `x` number, double: The `x` position for the flick.
        - `y` number, double: The `y` position for the flick.
      - `subtestPublicId` string: Public ID of the test to be played as part of a `playSubTest` step type.
      - `value` union: Values used in the step for in multiple step types.
        - string: Value used in the step for in multiple step types.
        - integer: Value used in the step for in multiple step types.
      - `variable` SyntheticsMobileStepParamsVariable: Variable object for `extractVariable` step type.
        - `example` string, required: An example for the variable.
        - `name` string, required: The variable name.
      - `withEnter` boolean: Boolean to indicate if `Enter` should be pressed at the end of the `typeText` step type.
      - `x` number, double: Amount to scroll by on the `x` axis for a `scroll` step type.
      - `y` number, double: Amount to scroll by on the `y` axis for a `scroll` step type.
    - `publicId` string: The public ID of the step.
    - `timeout` integer: The time before declaring a step failed.
    - `type` 'assertElementContent' | 'assertScreenContains' | 'assertScreenLacks' | 'doubleTap' | 'extractVariable' | 'flick' | 'openDeeplink' | 'playSubTest' | 'pressBack' | 'restartApplication' | 'rotate' | 'scroll' | 'scrollToElement' | 'tap' | 'toggleWiFi' | 'typeText' | 'wait', required: Step type used in your mobile Synthetic test.
  - `tags` string[]: Array of tags attached to the test.
  - `type` 'mobile', required: Type of the Synthetic test, `mobile`.

## Response `200`

OK

- SyntheticsMobileTest: Object containing details about a Synthetic mobile test.
  - `config` SyntheticsMobileTestConfig, required: Configuration object for a Synthetic mobile test.
    - `initialApplicationArguments` SyntheticsMobileTestInitialApplicationArguments: Initial application arguments for a mobile test.
    - `variables` SyntheticsConfigVariable[]: Array of variables used for the test steps.
      - `example` string: Example for the variable.
      - `id` string: ID of the variable for global variables.
      - `name` string, required: Name of the variable.
      - `pattern` string: Pattern of the variable.
      - `secure` boolean: Whether the value of this variable will be obfuscated in test results. Only for config variables of type `text`.
      - `type` 'global' | 'text' | 'email', required: Type of the configuration variable.
  - `device_ids` SyntheticsDeviceID[]: Array with the different device IDs used to run the test.
  - `message` string, required: Notification message associated with the test.
  - `monitor_id` integer: The associated monitor ID.
  - `name` string, required: Name of the test.
  - `options` SyntheticsMobileTestOptions, required: Object describing the extra options for a Synthetic test.
    - `allowApplicationCrash` boolean: A boolean to set if an application crash would mark the test as failed.
    - `bindings` SyntheticsTestRestrictionPolicyBinding[]: Array of bindings used for the mobile test.
      - `principals` string[]: List of principals for a mobile test binding.
      - `relation` 'editor' | 'viewer': The type of relation for the binding.
    - `ci` SyntheticsTestCiOptions: CI/CD options for a Synthetic test.
      - `executionRule` 'blocking' | 'non_blocking' | 'skipped', required: Execution rule for a Synthetic test.
    - `defaultStepTimeout` integer: The default timeout for steps in the test (in seconds).
    - `device_ids` SyntheticsDeviceID[], required: For mobile test, array with the different device IDs used to run the test.
    - `disableAutoAcceptAlert` boolean: A boolean to disable auto accepting alerts.
    - `min_failure_duration` integer: Minimum amount of time in failure required to trigger an alert.
    - `mobileApplication` SyntheticsMobileTestsMobileApplication, required: Mobile application for mobile synthetics test.
      - `applicationId` string, required: Application ID of the mobile application.
      - `referenceId` string, required: Reference ID of the mobile application.
      - `referenceType` 'latest' | 'version', required: Reference type for the mobile application for a mobile synthetics test.
    - `monitor_name` string: The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.
    - `monitor_options` SyntheticsTestOptionsMonitorOptions: Object containing the options for a Synthetic test as a monitor (for example, renotification).
      - `escalation_message` string: Message to include in the escalation notification.
      - `notification_preset_name` 'show_all' | 'hide_all' | 'hide_query' | 'hide_handles' | 'hide_query_and_handles' | 'show_only_snapshot' | 'hide_handles_and_footer': The name of the preset for the notification for the monitor.
      - `renotify_interval` integer: Time interval before renotifying if the test is still failing (in minutes).
      - `renotify_occurrences` integer: The number of times to renotify if the test is still failing.
    - `monitor_priority` integer: Integer from 1 (high) to 5 (low) indicating alert severity.
    - `noScreenshot` boolean: A boolean set to not take a screenshot for the step.
    - `restricted_roles` string[]: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
    - `retry` SyntheticsTestOptionsRetry: Object describing the retry strategy to apply to a Synthetic test.
      - `count` integer: Number of times a test needs to be retried before marking a location as failed. Defaults to 0.
      - `interval` number, double: Time interval between retries (in milliseconds). Defaults to 300ms.
    - `scheduling` SyntheticsTestOptionsScheduling: Object containing timeframes and timezone used for advanced scheduling.
      - `timeframes` SyntheticsTestOptionsSchedulingTimeframe[], required: Array containing objects describing the scheduling pattern to apply to each day.
        - `day` integer, required: Number representing the day of the week.
        - `from` string, required: The hour of the day on which scheduling starts.
        - `to` string, required: The hour of the day on which scheduling ends.
      - `timezone` string, required: Timezone in which the timeframe is based.
    - `tick_every` integer, required: The frequency at which to run the Synthetic test (in seconds).
    - `verbosity` integer: The level of verbosity for the mobile test. This field can not be set by a user.
  - `public_id` string: The public ID of the test.
  - `status` 'live' | 'paused': Define whether you want to start (`live`) or pause (`paused`) a Synthetic test.
  - `steps` SyntheticsMobileStep[]: Array of steps for the test.
    - `allowFailure` boolean: A boolean set to allow this step to fail.
    - `hasNewStepElement` boolean: A boolean set to determine if the step has a new step element.
    - `isCritical` boolean: A boolean to use in addition to `allowFailure` to determine if the test should be marked as failed when the step fails.
    - `name` string, required: The name of the step.
    - `noScreenshot` boolean: A boolean set to not take a screenshot for the step.
    - `params` SyntheticsMobileStepParams, required: The parameters of a mobile step.
      - `check` 'equals' | 'notEquals' | 'contains' | 'notContains' | 'startsWith' | 'notStartsWith' | 'greater' | 'lower' | 'greaterEquals' | 'lowerEquals' | 'matchRegex' | 'between' | 'isEmpty' | 'notIsEmpty': Type of assertion to apply in an API test.
      - `delay` integer: Number of milliseconds to wait between inputs in a `typeText` step type.
      - `direction` 'up' | 'down' | 'left' | 'right': The direction of the scroll for a `scrollToElement` step type.
      - `element` SyntheticsMobileStepParamsElement: Information about the element used for a step.
        - `context` string: Context of the element.
        - `contextType` 'native' | 'web': Type of the context that the element is in.
        - `elementDescription` string: Description of the element.
        - `multiLocator` object: Multi-locator to find the element.
        - `relativePosition` SyntheticsMobileStepParamsElementRelativePosition: Position of the action relative to the element.
          - `x` number, double: The `relativePosition` on the `x` axis for the element.
          - `y` number, double: The `relativePosition` on the `y` axis for the element.
        - `textContent` string: Text content of the element.
        - `userLocator` SyntheticsMobileStepParamsElementUserLocator: User locator to find the element.
          - `failTestOnCannotLocate` boolean: Whether if the test should fail if the element cannot be found.
          - `values` SyntheticsMobileStepParamsElementUserLocatorValuesItems[]: Values of the user locator.
            - `type` 'accessibility-id' | 'id' | 'ios-predicate-string' | 'ios-class-chain' | 'xpath': Type of a user locator.
            - `value` string: Value of a user locator.
        - `viewName` string: Name of the view of the element.
      - `enabled` boolean: Boolean to change the state of the wifi for a `toggleWiFi` step type.
      - `maxScrolls` integer: Maximum number of scrolls to do for a `scrollToElement` step type.
      - `positions` SyntheticsMobileStepParamsPositionsItems[]: List of positions for the `flick` step type. The maximum is 10 flicks per step
        - `x` number, double: The `x` position for the flick.
        - `y` number, double: The `y` position for the flick.
      - `subtestPublicId` string: Public ID of the test to be played as part of a `playSubTest` step type.
      - `value` union: Values used in the step for in multiple step types.
        - string: Value used in the step for in multiple step types.
        - integer: Value used in the step for in multiple step types.
      - `variable` SyntheticsMobileStepParamsVariable: Variable object for `extractVariable` step type.
        - `example` string, required: An example for the variable.
        - `name` string, required: The variable name.
      - `withEnter` boolean: Boolean to indicate if `Enter` should be pressed at the end of the `typeText` step type.
      - `x` number, double: Amount to scroll by on the `x` axis for a `scroll` step type.
      - `y` number, double: Amount to scroll by on the `y` axis for a `scroll` step type.
    - `publicId` string: The public ID of the step.
    - `timeout` integer: The time before declaring a step failed.
    - `type` 'assertElementContent' | 'assertScreenContains' | 'assertScreenLacks' | 'doubleTap' | 'extractVariable' | 'flick' | 'openDeeplink' | 'playSubTest' | 'pressBack' | 'restartApplication' | 'rotate' | 'scroll' | 'scrollToElement' | 'tap' | 'toggleWiFi' | 'typeText' | 'wait', required: Step type used in your mobile Synthetic test.
  - `tags` string[]: Array of tags attached to the test.
  - `type` 'mobile', required: Type of the Synthetic test, `mobile`.

## Other responses

- `400`: - JSON format is wrong - Updating sub-type is forbidden
- `403`: Forbidden
- `404`: - Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
