# Cloning Scheduled Tests with Modified Source, Destination, and Schedule Using the NetBeez API

**URL:** <https://community.netbeez.net/t/cloning-scheduled-tests-with-modified-source-destination-and-schedule-using-the-netbeez-api/146>\
**Category:** APIs & Developer Support\
**Created:** [January 19, 2024, 4:33am UTC](https://community.netbeez.net/t/cloning-scheduled-tests-with-modified-source-destination-and-schedule-using-the-netbeez-api/146 "2024-01-19T04:33:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![panickos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.netbeez.net/panickos/32/8_2.png) [@panickos](https://community.netbeez.net/u/panickos)\
**Post date:** [January 19, 2024, 4:33am UTC](https://community.netbeez.net/t/cloning-scheduled-tests-with-modified-source-destination-and-schedule-using-the-netbeez-api/146/1 "2024-01-19T04:33:33Z")

</div>

**Looking to create a new scheduled test based on an existing one, but with some adjustments to the source, destination, or schedule? The NetBeez API makes it easy to achieve this!**

**In this guide, we’ll walk you through the steps involved in retrieving an existing test definition, modifying the necessary attributes, and creating a new test using the API.**

**Prerequisites:**

- Access to the NetBeez BeezKeeper API.
- A tool for making API requests (e.g., Postman, curl, or a programming language like Python).
- Understanding of basic API concepts and JSON data structures.

**Steps:**

1. **Retrieve the Existing Test Definition:**

2. **Modify the Attributes:**

3. **Create the New Test:**

**Example:**

**Here’s an example of the request body for creating a new test based on the provided sample data, with a modified target agent and schedule:**

```json
{
    "scheduled_nb_test_template": {
        "test_type_id": 5,
        "agent_ids": [
            6 // New source agent ID
        ],
        "target_is_agent": 134, // New target agent ID
        "cron_schedule": "0 9,15,21 * * 1,2,3,4,5", // Modified schedule
        // ... other test configuration options
    }
}

```

**Remember:**

- The `agent_ids` array should only contain one agent ID when using `target_is_agent`.
- The `target` attribute can be omitted when using `target_is_agent`.
- Refer to the NetBeez API documentation at [https://api.netbeez.net](https://api.netbeez.net).

**By following these steps and leveraging the NetBeez API, you can efficiently create new scheduled tests based on existing ones, ensuring flexibility and customization in your network monitoring setup.**
