# Statuses

> Create, set, find, and delete statuses, and read their notifications.

A status is a named record of the current condition of one thing, such as “Tank pressure”. Arc automations, scripts, tasks, and people set statuses, and the Synnax Console shows each change as a notification. Statuses are the base of [alarms](https://docs.synnaxlabs.com/reference/alarms) in Synnax.

## Set a status

Setting a status with a key that already exists replaces the whole status. Give every field each time, or the fields that you leave out become empty.

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

**Console**

1. Run the “Create status” command from the [command palette](https://docs.synnaxlabs.com/reference/get-started/ui-overview#search-and-command-palette), or click in the statuses toolbar or the status explorer.
2. Enter a name, then select a **Variant** and enter a **Message**.
3. Optional: select labels.
4. Click **Create**.

**Python**

```python
import synnax as sy

client.statuses.set(
    sy.Status(
        key="tank-pressure",
        name="Tank pressure",
        variant="warning",
        message="Above 600 psi",
        description="Vent the tank before you continue.",
    )
)
```

**TypeScript**

```typescript
await client.statuses.set({
  key: "tank-pressure",
  name: "Tank pressure",
  variant: "warning",
  message: "Above 600 psi",
  description: "Vent the tank before you continue.",
});
```

**Arc**

An [Arc automation](https://docs.synnaxlabs.com/reference/control/arc) sets a status when a condition is true. `status.set` finds the status by its key or its name, and creates it when none matches:

```arc
import status

tank_pressure > 600.0 => status.set(
    key_or_name="tank-pressure",
    variant="warning",
    message="Tank pressure is above 600 psi",
)
```

To set the status once for each change, and to clear it, see [Arc alarms](https://docs.synnaxlabs.com/reference/alarms/arc).

## Find statuses

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

**Console**

Press **S** or click on the left side of the Console to open the statuses toolbar. It shows your favorite statuses with their variant, name, message, labels, and the time since their last change.

To see every status, run the “Open status explorer” command, or click the explore button in the statuses toolbar. In the explorer, search by name and filter by label and by variant.

**Python**

```python
status = client.statuses.retrieve(key="tank-pressure")
errors = client.statuses.retrieve(variants=["error"])
```

**TypeScript**

```typescript
const status = await client.statuses.retrieve("tank-pressure");
```

## Rename, favorite, or delete statuses

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

**Console**

In the status explorer, right-click one or more statuses and select:

* **Rename** -> change the name.
* **Favorite** or **Unfavorite** -> add them to the statuses toolbar or remove them.
* **Copy diagnostics** -> copy the details to the clipboard.
* **Delete** -> delete them, after you confirm.

**Python**

```python
client.statuses.rename("tank-pressure", "Main tank pressure")
client.statuses.delete("tank-pressure")
```

**TypeScript**

```typescript
await client.statuses.rename("tank-pressure", "Main tank pressure");
await client.statuses.delete("tank-pressure");
```

## Notifications

When a status changes, the Console shows a notification in the corner of the window.

* The Console shows notifications only while it is connected to the Core.
* A notification closes 7 seconds after the Console gets the status.
* The Console shows one notification for each status key. A new change replaces it.
* Different statuses with the same name, variant, message, and description merge into one notification with a count.
* The Console shows up to four notifications. Click **+N more** to see the rest, and **Clear all** to close them.
* When you close a notification, the Console does not show that status again until you restart it.

Tasks, Drivers, devices, and calculated channels set statuses too. The Console shows only their warnings and errors, and only for things that are in use:

* A device is in use when it is configured.
* A Driver scanner, which looks for one kind of device, is in use when its Driver has a configured device of that kind.
* Every other task, each Driver, and each calculated channel is always in use.

A warning from a task, device, or Driver shows only if it does not clear within 5 seconds.

When you send a command to a task, such as start or stop, the Console shows the answer unless it is a success, loading, or disabled status.

## Reference

### Fields

| Field       | Required | Description                                                                                            |
| ----------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Key         |          | The unique ID of the status. Synnax makes one when you leave it out.                                   |
| Name        |          | What the status is about, such as “Tank pressure”.                                                     |
| Variant     |          | The kind of condition. See [variants](https://docs.synnaxlabs.com/reference/alarms/statuses#variants). |
| Message     |          | What happened, or the current state, in one short line.                                                |
| Description |          | Why, and what to do now, in full sentences.                                                            |
| Time        |          | The time of the change. The default is now.                                                            |
| Details     |          | Extra data in JSON, such as the value that set off the alarm.                                          |
| Labels      |          | Labels that group related statuses. Set them in the Console.                                           |

### Variants

| Variant  | Use it for                                      |
| -------- | ----------------------------------------------- |
| Success  | A nominal condition, or a problem that cleared. |
| Info     | Information that needs no action.               |
| Warning  | A condition that needs attention.               |
| Error    | A failure or a condition out of limits.         |
| Loading  | An operation that is in progress.               |
| Disabled | A part of the system that is not active.        |
