# Timezone API — Spectra Analyze

> Set and query system timezone on Spectra Analyze appliances to control date and time display preferences via API.

This API allows users to set the timezone for the appliance and list available timezones.

## Set the timezone for the appliance

This API allows users to set the timezone for the appliance.

```
POST api/v1/config/configure-timezone/
```

### Request Format

**Request Parameters**

| NAME         | REQUIRED | DESCRIPTION                            | TYPE             |
|:-------------|:---------|:---------------------------------------|:-----------------|
| timezone     | Required | Timezone to set for the appliance.     | application/json |

**Request Examples**

**cURL**

```shell
# Add --insecure before the URL if you are using a self-signed SSL certificate
curl -X 'POST' \
  'http://api.example.com/api/v1/config/configure-timezone/' \
  -H 'Authorization: Token <token-here>' \
  --json '{"timezone": "Europe/Zagreb"}'
```

**Python**

```python

# Change the values of the URL, headers, and data
url = "http://api.example.com/api/v1/config/configure-timezone/"
headers = {
    "Authorization": f"Token <token-here>",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
data = {
    "timezone": "Europe/Zagreb"
}

# Add verify=False in the request if you are using a self-signed SSL certificate
response = requests.post(url, headers=headers, json=data, verify=False)

print(response.status_code)
print(response.text)
```

### Response Format

The response does not return any data or response body.

## List available timezones

This API allows users to list available timezones for the appliance.

```
GET api/v1/config/list-available-timezones/
```

**Request example**

**cURL**

```shell
curl 'http://api.example.com/api/v1/config/list-available-timezones/' \
  -H 'Authorization: Token <token-here>'
```

### Response Format

The response format returns a list of available timezones.

```json
{
    "timezones": [
        "Africa/Abidjan",
        "Africa/Accra",
        "Africa/Addis_Ababa",
        "Africa/Algiers",
        "Africa/Asmara",
        "Africa/Bamako",
        "Africa/Bangui",
        "Africa/Banjul",
        "Africa/Bissau",
        "Africa/Blantyre",
        "Africa/Brazzaville",
        "Africa/Bujumbura",
        "Africa/Cairo",
        "Africa/Casablanca",
        "Africa/Ceuta",
        "Pacific/Wallis",
        "UTC"
    ]
}
```

**Response Status Codes**

| CODE | DESCRIPTION |
| :--- | :---------- |
| 200  | OK          |
