# Update details of a single station.

`PUT /admin/station/{id}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKey": []
  }
]
```

- ApiKey: apiKey, header X-API-Key

Parameters:

- `id` (path, integer, int64, required) - ID
  Type: integer, int64

Request body: application/json

Type: object

Schema: [Station](https://sourcey-azuracast.pages.dev/docs/api/models/station/index.md)

allOf:
  Reference: [HasAutoIncrementId](https://sourcey-azuracast.pages.dev/docs/api/models/hasautoincrementid/index.md); Type: object

  Type: object
  
  - `name` (optional)
    Type: string
    
    The full display name of the station.
    
    Example:
    
    ```json
    "AzuraTest Radio"
    ```
  
  - `short_name` (optional)
    Type: string
    
    The URL-friendly name for the station, typically auto-generated from the full station name.
    
    Example:
    
    ```json
    "azuratest_radio"
    ```
  
  - `is_enabled` (optional)
    Type: boolean
    
    If set to 'false', prevents the station from broadcasting but leaves it in the database.
    
    Example:
    
    ```json
    true
    ```
  
  - `frontend_type` (optional)
    Reference: [FrontendAdapters](https://sourcey-azuracast.pages.dev/docs/api/models/frontendadapters/index.md); Type: string
    
    enum: ["icecast","shoutcast2","rsas","remote"]
  
  - `frontend_config` (optional)
    Reference: [StationFrontendConfiguration](https://sourcey-azuracast.pages.dev/docs/api/models/stationfrontendconfiguration/index.md); Type: object
  
  - `backend_type` (optional)
    Reference: [BackendAdapters](https://sourcey-azuracast.pages.dev/docs/api/models/backendadapters/index.md); Type: string
    
    enum: ["liquidsoap","none"]
  
  - `backend_config` (optional)
    Reference: [StationBackendConfiguration](https://sourcey-azuracast.pages.dev/docs/api/models/stationbackendconfiguration/index.md); Type: object
  
  - `description` (optional)
    Type: string; nullable
    
    Example:
    
    ```json
    "A sample radio station."
    ```
  
  - `url` (optional)
    Type: string; nullable
    
    Example:
    
    ```json
    "https://demo.azuracast.com/"
    ```
  
  - `genre` (optional)
    Type: string; nullable
    
    Example:
    
    ```json
    "Various"
    ```
  
  - `radio_base_dir` (optional)
    Type: string
    
    Example:
    
    ```json
    "/var/azuracast/stations/azuratest_radio"
    ```
  
  - `enable_requests` (optional)
    Type: boolean
    
    Whether listeners can request songs to play on this station.
    
    Example:
    
    ```json
    true
    ```
  
  - `request_delay` (optional)
    Type: integer; nullable
    
    Example:
    
    ```json
    5
    ```
  
  - `request_threshold` (optional)
    Type: integer; nullable
    
    Example:
    
    ```json
    15
    ```
  
  - `requests_only_via_playlists` (optional)
    Type: boolean
    
    Example:
    
    ```json
    false
    ```
  
  - `disconnect_deactivate_streamer` (optional)
    Type: integer; nullable
    
    Example:
    
    ```json
    0
    ```
  
  - `enable_streamers` (optional)
    Type: boolean
    
    Whether streamers are allowed to broadcast to this station at all.
    
    Example:
    
    ```json
    false
    ```
  
  - `is_streamer_live` (optional)
    Type: boolean
    
    Whether a streamer is currently active on the station.
    
    Example:
    
    ```json
    false
    ```
  
  - `enable_public_page` (optional)
    Type: boolean
    
    Whether this station's public pages (player, on-demand streaming, etc.) are visible to non-authenticated users.
    
    Example:
    
    ```json
    true
    ```
  
  - `enable_public_api` (optional)
    Type: boolean
    
    Whether the public-facing API endpoints (now playing, art, etc.) are visible to non-authenticated users. Automatically enabled if 'enable_public_page' is true.
    
    Example:
    
    ```json
    true
    ```
  
  - `enable_on_demand` (optional)
    Type: boolean
    
    Whether this station has a public 'on-demand' streaming and download page.
    
    Example:
    
    ```json
    true
    ```
  
  - `enable_on_demand_download` (optional)
    Type: boolean
    
    Whether the 'on-demand' page offers download capability.
    
    Example:
    
    ```json
    true
    ```
  
  - `enable_hls` (optional)
    Type: boolean
    
    Whether HLS streaming is enabled.
    
    Example:
    
    ```json
    true
    ```
  
  - `api_history_items` (optional)
    Type: integer
    
    The number of 'last played' history items to show for a station in API responses.
    
    Example:
    
    ```json
    5
    ```
  
  - `timezone` (optional)
    Type: string
    
    The time zone that station operations should take place in.
    
    Example:
    
    ```json
    "UTC"
    ```
  
  - `max_bitrate` (optional)
    Type: integer
    
    The maximum bitrate at which a station may broadcast, in Kbps. 0 for unlimited
    
    Example:
    
    ```json
    128
    ```
  
  - `max_mounts` (optional)
    Type: integer
    
    The maximum number of mount points the station can have, 0 for unlimited
    
    Example:
    
    ```json
    3
    ```
  
  - `max_hls_streams` (optional)
    Type: integer
    
    The maximum number of HLS streams the station can have, 0 for unlimited
    
    Example:
    
    ```json
    3
    ```
  
  - `branding_config` (optional)
    Reference: [StationBrandingConfiguration](https://sourcey-azuracast.pages.dev/docs/api/models/stationbrandingconfiguration/index.md); Type: object

Responses:

- 200: Success

Content type: application/json

Type: object

Schema: [Api_Status](https://sourcey-azuracast.pages.dev/docs/api/models/api-status/index.md)

- `success` (required)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Changes saved successfully."
  ```

- `formatted_message` (required)
  Type: string
  
  Example:
  
  ```json
  "<b>Changes saved successfully.</b>"
  ```

- 403: Access denied.

Content type: application/json

Type: object

Schema: [Api_Error](https://sourcey-azuracast.pages.dev/docs/api/models/api-error/index.md)

- `code` (required)
  Type: integer
  
  The numeric code of the error.
  
  Example:
  
  ```json
  500
  ```

- `type` (required)
  Type: string
  
  The programmatic class of error.
  
  Example:
  
  ```json
  "NotLoggedInException"
  ```

- `message` (required)
  Type: string
  
  The text description of the error.
  
  Example:
  
  ```json
  "Error description."
  ```

- `formatted_message` (required)
  Type: string; nullable
  
  The HTML-formatted text description of the error.
  
  Example:
  
  ```json
  "<b>Error description.</b><br>Detailed error text."
  ```

- `extra_data` (required)
  Type: array
  
  Stack traces and other supplemental data.
  
  Items:
    Type: any

- `success` (required)
  Type: boolean
  
  Used for API calls that expect an \Entity\Api\Status type response.
  
  Example:
  
  ```json
  false
  ```

- 404: Record not found.

Content type: application/json

Type: object

Schema: [Api_Error](https://sourcey-azuracast.pages.dev/docs/api/models/api-error/index.md)

- `code` (required)
  Type: integer
  
  The numeric code of the error.
  
  Example:
  
  ```json
  500
  ```

- `type` (required)
  Type: string
  
  The programmatic class of error.
  
  Example:
  
  ```json
  "NotLoggedInException"
  ```

- `message` (required)
  Type: string
  
  The text description of the error.
  
  Example:
  
  ```json
  "Error description."
  ```

- `formatted_message` (required)
  Type: string; nullable
  
  The HTML-formatted text description of the error.
  
  Example:
  
  ```json
  "<b>Error description.</b><br>Detailed error text."
  ```

- `extra_data` (required)
  Type: array
  
  Stack traces and other supplemental data.
  
  Items:
    Type: any

- `success` (required)
  Type: boolean
  
  Used for API calls that expect an \Entity\Api\Status type response.
  
  Example:
  
  ```json
  false
  ```

- 500: A generic exception has occurred.

Content type: application/json

Type: object

Schema: [Api_Error](https://sourcey-azuracast.pages.dev/docs/api/models/api-error/index.md)

- `code` (required)
  Type: integer
  
  The numeric code of the error.
  
  Example:
  
  ```json
  500
  ```

- `type` (required)
  Type: string
  
  The programmatic class of error.
  
  Example:
  
  ```json
  "NotLoggedInException"
  ```

- `message` (required)
  Type: string
  
  The text description of the error.
  
  Example:
  
  ```json
  "Error description."
  ```

- `formatted_message` (required)
  Type: string; nullable
  
  The HTML-formatted text description of the error.
  
  Example:
  
  ```json
  "<b>Error description.</b><br>Detailed error text."
  ```

- `extra_data` (required)
  Type: array
  
  Stack traces and other supplemental data.
  
  Items:
    Type: any

- `success` (required)
  Type: boolean
  
  Used for API calls that expect an \Entity\Api\Status type response.
  
  Example:
  
  ```json
  false
  ```

## Examples

### cURL

```bash
curl -X PUT 'https://demo.azuracast.com/api/admin/station/0' \
  -H 'X-API-Key: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "AzuraTest Radio",
  "short_name": "azuratest_radio",
  "is_enabled": true,
  "frontend_type": "icecast",
  "frontend_config": {
    "custom_config": "string",
    "source_pw": "string",
    "admin_pw": "string",
    "relay_pw": "string",
    "streamer_pw": "string",
    "port": 0,
    "max_listeners": 0,
    "banned_ips": "string",
    "banned_user_agents": "string",
    "banned_countries": [
      "string"
    ],
    "allowed_ips": "string",
    "sc_license_id": "string",
    "sc_user_id": "string"
  },
  "backend_type": "liquidsoap",
  "backend_config": {
    "charset": "string",
    "dj_port": 0,
    "telnet_port": 0,
    "record_streams": true,
    "record_streams_format": "string",
    "record_streams_bitrate": 0,
    "use_manual_autodj": true,
    "reset_sequential_queues_on_restart": false,
    "autodj_queue_length": 0,
    "dj_mount_point": "string",
    "dj_buffer": 0,
    "audio_processing_method": "string",
    "post_processing_include_live": true,
    "stereo_tool_license_key": "string",
    "stereo_tool_configuration_path": "string",
    "master_me_preset": "string",
    "master_me_loudness_target": 0,
    "enable_replaygain_metadata": true,
    "crossfade_type": "string",
    "crossfade": 0,
    "crossfade_smart_high": 0,
    "crossfade_smart_medium": 0,
    "crossfade_smart_margin": 0,
    "duplicate_prevention_time_range": 120,
    "duplicate_prevention_artist_time_range": 120,
    "performance_mode": "string",
    "hls_segment_length": 0,
    "hls_segments_in_playlist": 0,
    "hls_segments_overhead": 0,
    "hls_enable_on_public_player": true,
    "hls_is_default": true,
    "live_broadcast_text": "string",
    "enable_auto_cue": true,
    "write_playlists_to_liquidsoap": true,
    "share_encoders": true,
    "custom_config_top": "string",
    "custom_config_pre_playlists": "string",
    "custom_config_pre_live": "string",
    "custom_config_pre_fade": "string",
    "custom_config": "string",
    "custom_config_bottom": "string"
  },
  "description": "A sample radio station.",
  "url": "https://demo.azuracast.com/",
  "genre": "Various",
  "radio_base_dir": "/var/azuracast/stations/azuratest_radio",
  "enable_requests": true,
  "request_delay": 5,
  "request_threshold": 15,
  "requests_only_via_playlists": false,
  "disconnect_deactivate_streamer": 0,
  "enable_streamers": false,
  "is_streamer_live": false,
  "enable_public_page": true,
  "enable_public_api": true,
  "enable_on_demand": true,
  "enable_on_demand_download": true,
  "enable_hls": true,
  "api_history_items": 5,
  "timezone": "UTC",
  "max_bitrate": 128,
  "max_mounts": 3,
  "max_hls_streams": 3,
  "branding_config": {
    "default_album_art_url": "string",
    "public_custom_css": "string",
    "public_custom_js": "string",
    "offline_text": "string"
  }
}'
```

### JavaScript

```javascript
const body = `{
  "name": "AzuraTest Radio",
  "short_name": "azuratest_radio",
  "is_enabled": true,
  "frontend_type": "icecast",
  "frontend_config": {
    "custom_config": "string",
    "source_pw": "string",
    "admin_pw": "string",
    "relay_pw": "string",
    "streamer_pw": "string",
    "port": 0,
    "max_listeners": 0,
    "banned_ips": "string",
    "banned_user_agents": "string",
    "banned_countries": [
      "string"
    ],
    "allowed_ips": "string",
    "sc_license_id": "string",
    "sc_user_id": "string"
  },
  "backend_type": "liquidsoap",
  "backend_config": {
    "charset": "string",
    "dj_port": 0,
    "telnet_port": 0,
    "record_streams": true,
    "record_streams_format": "string",
    "record_streams_bitrate": 0,
    "use_manual_autodj": true,
    "reset_sequential_queues_on_restart": false,
    "autodj_queue_length": 0,
    "dj_mount_point": "string",
    "dj_buffer": 0,
    "audio_processing_method": "string",
    "post_processing_include_live": true,
    "stereo_tool_license_key": "string",
    "stereo_tool_configuration_path": "string",
    "master_me_preset": "string",
    "master_me_loudness_target": 0,
    "enable_replaygain_metadata": true,
    "crossfade_type": "string",
    "crossfade": 0,
    "crossfade_smart_high": 0,
    "crossfade_smart_medium": 0,
    "crossfade_smart_margin": 0,
    "duplicate_prevention_time_range": 120,
    "duplicate_prevention_artist_time_range": 120,
    "performance_mode": "string",
    "hls_segment_length": 0,
    "hls_segments_in_playlist": 0,
    "hls_segments_overhead": 0,
    "hls_enable_on_public_player": true,
    "hls_is_default": true,
    "live_broadcast_text": "string",
    "enable_auto_cue": true,
    "write_playlists_to_liquidsoap": true,
    "share_encoders": true,
    "custom_config_top": "string",
    "custom_config_pre_playlists": "string",
    "custom_config_pre_live": "string",
    "custom_config_pre_fade": "string",
    "custom_config": "string",
    "custom_config_bottom": "string"
  },
  "description": "A sample radio station.",
  "url": "https://demo.azuracast.com/",
  "genre": "Various",
  "radio_base_dir": "/var/azuracast/stations/azuratest_radio",
  "enable_requests": true,
  "request_delay": 5,
  "request_threshold": 15,
  "requests_only_via_playlists": false,
  "disconnect_deactivate_streamer": 0,
  "enable_streamers": false,
  "is_streamer_live": false,
  "enable_public_page": true,
  "enable_public_api": true,
  "enable_on_demand": true,
  "enable_on_demand_download": true,
  "enable_hls": true,
  "api_history_items": 5,
  "timezone": "UTC",
  "max_bitrate": 128,
  "max_mounts": 3,
  "max_hls_streams": 3,
  "branding_config": {
    "default_album_art_url": "string",
    "public_custom_css": "string",
    "public_custom_js": "string",
    "offline_text": "string"
  }
}`;

const response = await fetch('https://demo.azuracast.com/api/admin/station/0', {
  method: 'PUT',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "AzuraTest Radio",
  "short_name": "azuratest_radio",
  "is_enabled": true,
  "frontend_type": "icecast",
  "frontend_config": {
    "custom_config": "string",
    "source_pw": "string",
    "admin_pw": "string",
    "relay_pw": "string",
    "streamer_pw": "string",
    "port": 0,
    "max_listeners": 0,
    "banned_ips": "string",
    "banned_user_agents": "string",
    "banned_countries": [
      "string"
    ],
    "allowed_ips": "string",
    "sc_license_id": "string",
    "sc_user_id": "string"
  },
  "backend_type": "liquidsoap",
  "backend_config": {
    "charset": "string",
    "dj_port": 0,
    "telnet_port": 0,
    "record_streams": true,
    "record_streams_format": "string",
    "record_streams_bitrate": 0,
    "use_manual_autodj": true,
    "reset_sequential_queues_on_restart": false,
    "autodj_queue_length": 0,
    "dj_mount_point": "string",
    "dj_buffer": 0,
    "audio_processing_method": "string",
    "post_processing_include_live": true,
    "stereo_tool_license_key": "string",
    "stereo_tool_configuration_path": "string",
    "master_me_preset": "string",
    "master_me_loudness_target": 0,
    "enable_replaygain_metadata": true,
    "crossfade_type": "string",
    "crossfade": 0,
    "crossfade_smart_high": 0,
    "crossfade_smart_medium": 0,
    "crossfade_smart_margin": 0,
    "duplicate_prevention_time_range": 120,
    "duplicate_prevention_artist_time_range": 120,
    "performance_mode": "string",
    "hls_segment_length": 0,
    "hls_segments_in_playlist": 0,
    "hls_segments_overhead": 0,
    "hls_enable_on_public_player": true,
    "hls_is_default": true,
    "live_broadcast_text": "string",
    "enable_auto_cue": true,
    "write_playlists_to_liquidsoap": true,
    "share_encoders": true,
    "custom_config_top": "string",
    "custom_config_pre_playlists": "string",
    "custom_config_pre_live": "string",
    "custom_config_pre_fade": "string",
    "custom_config": "string",
    "custom_config_bottom": "string"
  },
  "description": "A sample radio station.",
  "url": "https://demo.azuracast.com/",
  "genre": "Various",
  "radio_base_dir": "/var/azuracast/stations/azuratest_radio",
  "enable_requests": true,
  "request_delay": 5,
  "request_threshold": 15,
  "requests_only_via_playlists": false,
  "disconnect_deactivate_streamer": 0,
  "enable_streamers": false,
  "is_streamer_live": false,
  "enable_public_page": true,
  "enable_public_api": true,
  "enable_on_demand": true,
  "enable_on_demand_download": true,
  "enable_hls": true,
  "api_history_items": 5,
  "timezone": "UTC",
  "max_bitrate": 128,
  "max_mounts": 3,
  "max_hls_streams": 3,
  "branding_config": {
    "default_album_art_url": "string",
    "public_custom_css": "string",
    "public_custom_js": "string",
    "offline_text": "string"
  }
}'''

response = requests.put(
    'https://demo.azuracast.com/api/admin/station/0',
    data=body.encode('utf-8'),
    headers={
        'X-API-Key': 'YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
