# Edit and delete ranges

> Rename a range, change its times or stage, and delete it.

Rename a [range](https://docs.synnaxlabs.com/reference/ranges), change its times or its stage, or delete it. To change labels and metadata, see [metadata and labels](https://docs.synnaxlabs.com/reference/ranges/metadata).

## Rename a range

[Enterprise](https://docs.synnaxlabs.com/reference/get-started/editions "Needs Synnax Enterprise")

**Console**

Right-click the range in the ranges toolbar or the range explorer and select **Rename**. You can also click the name on the [range overview](https://docs.synnaxlabs.com/reference/ranges/find#range-overview).

**Python**

```python
client.ranges.rename(my_range.key, "My Updated Range")
```

**TypeScript**

```typescript
await client.ranges.rename(myRange.key, "My Updated Range");
```

## Change the times or the stage

[Enterprise](https://docs.synnaxlabs.com/reference/get-started/editions "Needs Synnax Enterprise")

**Console**

On the [range overview](https://docs.synnaxlabs.com/reference/ranges/find#range-overview), click the start or end time on the timeline and change it. To start, complete, or reopen the range, click its stage. Each stage change sets the start or end time. See [stages](https://docs.synnaxlabs.com/reference/ranges/reference#stages).

The Console cannot change the color or the parent of a range.

**Python**

Call `client.ranges.create` with the `key` of the range:

```python
from datetime import datetime

import synnax as sy

my_range = client.ranges.retrieve(name="My Range")
client.ranges.create(
    key=my_range.key,
    name="My Updated Range",
    time_range=sy.TimeRange(
        start=sy.TimeStamp(datetime(2023, 2, 12, 13, 0)),
        end=sy.TimeStamp(datetime(2023, 2, 12, 15, 0)),
    ),
    color="#00FF00",
)
```

**TypeScript**

Call `client.ranges.create` with the `key` of the range:

```typescript
import { TimeRange, TimeStamp } from "@synnaxlabs/client";

const myRange = await client.ranges.retrieve("My Range");
await client.ranges.create({
  key: myRange.key,
  name: "My Updated Range",
  timeRange: new TimeRange(
    new TimeStamp("2023-02-12 13:00:00"),
    new TimeStamp("2023-02-12 15:00:00"),
  ),
  color: "#00FF00",
});
```

**Arc**

An automation can only end a range that it created. `ranges.end` sets the end to the current time. Give it the key that `ranges.create` output:

```arc
import ranges

sequence test {
    run_key str $= ""
    stage idle {
        start_cmd == 1 => run
    }
    stage run {
        ranges.create{name="Hotfire", color="#3bc454"} -> run_key
        stop_cmd == 1 => done
    }
    stage done {
        ranges.end{key=run_key}
        start_cmd == 1 => run
    }
}

true => test
```

See [create ranges in Arc](https://docs.synnaxlabs.com/reference/ranges/arc).

> An update from Python or TypeScript replaces the name, the time range, and the color. Leave out the color and the range loses it. Labels are only added, and the parent stays when you leave it out. If no range has the key, Synnax creates a new range with that key.

## Delete a range

Deleting a range also deletes its child ranges. It does not delete the data of the channels in the range, and it does not delete its [snapshots](https://docs.synnaxlabs.com/reference/ranges/snapshots).

[Enterprise](https://docs.synnaxlabs.com/reference/get-started/editions "Needs Synnax Enterprise")

**Console**

Right-click the range in the ranges toolbar or the range explorer and select **Delete**, then confirm.

![](https://synnax.nyc3.cdn.digitaloceanspaces.com/docs/client/ranges/delete-light.png)

**Python**

```python
client.ranges.delete(my_range.key)
client.ranges.delete([my_range.key, my_other_range.key])
```

A key that matches no range is ignored.

**TypeScript**

```typescript
await client.ranges.delete(myRange.key);
await client.ranges.delete([myRange.key, myOtherRange.key]);
```
