# Update settings to modify any settings provided.

`PUT /admin/settings`

Authentication (security requirement alternatives):

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

- ApiKey: apiKey, header X-API-Key

Request body: application/json

Type: object

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

- `app_unique_identifier` (optional)
  Type: string

- `base_url` (optional)
  Type: string; nullable
  
  Site Base URL
  
  Example:
  
  ```json
  "https://your.azuracast.site"
  ```

- `instance_name` (optional)
  Type: string; nullable
  
  AzuraCast Instance Name
  
  Example:
  
  ```json
  "My AzuraCast Instance"
  ```

- `prefer_browser_url` (optional)
  Type: boolean
  
  Prefer Browser URL (If Available)
  
  Example:
  
  ```json
  "false"
  ```

- `use_radio_proxy` (optional)
  Type: boolean
  
  Use Web Proxy for Radio
  
  Example:
  
  ```json
  "false"
  ```

- `history_keep_days` (optional)
  Type: integer
  
  Days of Playback History to Keep

- `always_use_ssl` (optional)
  Type: boolean
  
  Always Use HTTPS
  
  Example:
  
  ```json
  "false"
  ```

- `api_access_control` (optional)
  Type: string; nullable
  
  API 'Access-Control-Allow-Origin' header
  
  Example:
  
  ```json
  "*"
  ```

- `enable_liquidsoap_editing` (optional)
  Type: boolean
  
  Allow stations to manually edit Liquidsoap code.
  
  Example:
  
  ```json
  "true"
  ```

- `enable_all_webhooks` (optional)
  Type: boolean
  
  Allow stations to dispatch webhooks.
  
  Example:
  
  ```json
  "true"
  ```

- `filter_local_user_urls` (optional)
  Type: boolean
  
  Prevent users from using local IPs or URLs in Webhooks, etc.
  
  Example:
  
  ```json
  "true"
  ```

- `enable_static_nowplaying` (optional)
  Type: boolean
  
  Whether to use high-performance static JSON for Now Playing data updates.
  
  Example:
  
  ```json
  "false"
  ```

- `analytics` (optional)
  Type: unknown; nullable
  
  Listener Analytics Collection
  
  oneOf:
    Reference: [AnalyticsLevel](https://sourcey-azuracast.pages.dev/docs/api/models/analyticslevel/index.md); Type: string
    
    enum: ["all","no_ip","none"]

- `check_for_updates` (optional)
  Type: boolean
  
  Check for Updates and Announcements
  
  Example:
  
  ```json
  "true"
  ```

- `update_results` (optional)
  Type: unknown; nullable
  
  Results of the latest update check.
  
  Example:
  
  ```json
  ""
  ```
  
  oneOf:
    Reference: [Api_Admin_UpdateDetails](https://sourcey-azuracast.pages.dev/docs/api/models/api-admin-updatedetails/index.md); Type: object

- `update_last_run` (optional)
  Type: integer
  
  The UNIX timestamp when updates were last checked.
  
  Example:
  
  ```json
  1609480800
  ```

- `public_theme` (optional)
  Type: unknown; nullable
  
  Base Theme for Public Pages
  
  Example:
  
  ```json
  "light"
  ```
  
  oneOf:
    Reference: [SupportedThemes](https://sourcey-azuracast.pages.dev/docs/api/models/supportedthemes/index.md); Type: string
    
    enum: ["browser","light","dark"]

- `hide_album_art` (optional)
  Type: boolean
  
  Hide Album Art on Public Pages
  
  Example:
  
  ```json
  "false"
  ```

- `homepage_redirect_url` (optional)
  Type: string; nullable
  
  Homepage Redirect URL
  
  Example:
  
  ```json
  "https://example.com/"
  ```

- `default_album_art_url` (optional)
  Type: string; nullable
  
  Default Album Art URL
  
  Example:
  
  ```json
  "https://example.com/image.jpg"
  ```

- `use_external_album_art_when_processing_media` (optional)
  Type: boolean
  
  Attempt to fetch album art from external sources when processing media.
  
  Example:
  
  ```json
  "false"
  ```

- `use_external_album_art_in_apis` (optional)
  Type: boolean
  
  Attempt to fetch album art from external sources in API requests.
  
  Example:
  
  ```json
  "false"
  ```

- `last_fm_api_key` (optional)
  Type: string; nullable
  
  An API key to connect to Last.fm services, if provided.
  
  Example:
  
  ```json
  "SAMPLE-API-KEY"
  ```

- `hide_product_name` (optional)
  Type: boolean
  
  Hide AzuraCast Branding on Public Pages
  
  Example:
  
  ```json
  "false"
  ```

- `public_custom_css` (optional)
  Type: string; nullable
  
  Custom CSS for Public Pages
  
  Example:
  
  ```json
  ""
  ```

- `public_custom_js` (optional)
  Type: string; nullable
  
  Custom JS for Public Pages
  
  Example:
  
  ```json
  ""
  ```

- `internal_custom_css` (optional)
  Type: string; nullable
  
  Custom CSS for Internal Pages
  
  Example:
  
  ```json
  ""
  ```

- `backup_enabled` (optional)
  Type: boolean
  
  Whether backup is enabled.
  
  Example:
  
  ```json
  "false"
  ```

- `backup_time_code` (optional)
  Type: string; nullable
  
  The timecode (i.e. 400 for 4:00AM) when automated backups should run.
  
  Example:
  
  ```json
  400
  ```

- `backup_exclude_media` (optional)
  Type: boolean
  
  Whether to exclude media in automated backups.
  
  Example:
  
  ```json
  "false"
  ```

- `backup_keep_copies` (optional)
  Type: integer
  
  Number of backups to keep, or infinite if zero/null.
  
  Example:
  
  ```json
  2
  ```

- `backup_storage_location` (optional)
  Type: integer; nullable
  
  The storage location ID for automated backups.
  
  Example:
  
  ```json
  1
  ```

- `backup_format` (optional)
  Type: string; nullable
  
  The output format for the automated backup.
  
  Example:
  
  ```json
  "zip"
  ```

- `backup_last_run` (optional)
  Type: integer
  
  The UNIX timestamp when automated backup was last run.
  
  Example:
  
  ```json
  1609480800
  ```

- `backup_last_output` (optional)
  Type: string; nullable
  
  The output of the latest automated backup task.
  
  Example:
  
  ```json
  ""
  ```

- `setup_complete_time` (optional)
  Type: integer
  
  The UNIX timestamp when setup was last completed.
  
  Example:
  
  ```json
  1609480800
  ```

- `sync_disabled` (optional)
  Type: boolean
  
  Temporarily disable all sync tasks.
  
  Example:
  
  ```json
  "false"
  ```

- `sync_last_run` (optional)
  Type: integer
  
  The last run timestamp for the unified sync task.
  
  Example:
  
  ```json
  1609480800
  ```

- `external_ip` (optional)
  Type: string; nullable
  
  This installation's external IP.
  
  Example:
  
  ```json
  "192.168.1.1"
  ```

- `geolite_license_key` (optional)
  Type: string; nullable
  
  The license key for the Maxmind Geolite download.
  
  Example:
  
  ```json
  ""
  ```

- `geolite_last_run` (optional)
  Type: integer
  
  The UNIX timestamp when the Maxmind Geolite was last downloaded.
  
  Example:
  
  ```json
  1609480800
  ```

- `mail_enabled` (optional)
  Type: boolean
  
  Enable e-mail delivery across the application.
  
  Example:
  
  ```json
  "true"
  ```

- `mail_sender_name` (optional)
  Type: string; nullable
  
  The name of the sender of system e-mails.
  
  Example:
  
  ```json
  "AzuraCast"
  ```

- `mail_sender_email` (optional)
  Type: string; nullable
  
  The e-mail address of the sender of system e-mails.
  
  Example:
  
  ```json
  "example@example.com"
  ```

- `mail_smtp_host` (optional)
  Type: string; nullable
  
  The host to send outbound SMTP mail.
  
  Example:
  
  ```json
  "smtp.example.com"
  ```

- `mail_smtp_port` (optional)
  Type: integer
  
  The port for sending outbound SMTP mail.
  
  Example:
  
  ```json
  465
  ```

- `mail_smtp_username` (optional)
  Type: string; nullable
  
  The username when connecting to SMTP mail.
  
  Example:
  
  ```json
  "username"
  ```

- `mail_smtp_password` (optional)
  Type: string; nullable
  
  The password when connecting to SMTP mail.
  
  Example:
  
  ```json
  "password"
  ```

- `mail_smtp_secure` (optional)
  Type: boolean
  
  Whether to use a secure (TLS) connection when sending SMTP mail.
  
  Example:
  
  ```json
  "true"
  ```

- `avatar_service` (optional)
  Type: string; nullable
  
  The external avatar service to use when fetching avatars.
  
  Example:
  
  ```json
  "libravatar"
  ```

- `avatar_default_url` (optional)
  Type: string; nullable
  
  The default avatar URL.
  
  Example:
  
  ```json
  ""
  ```

- `acme_email` (optional)
  Type: string; nullable
  
  ACME (LetsEncrypt) e-mail address.
  
  Example:
  
  ```json
  ""
  ```

- `acme_domains` (optional)
  Type: string; nullable
  
  ACME (LetsEncrypt) domain name(s).
  
  Example:
  
  ```json
  ""
  ```

- `ip_source` (optional)
  Type: unknown; nullable
  
  IP Address Source
  
  oneOf:
    Reference: [IpSources](https://sourcey-azuracast.pages.dev/docs/api/models/ipsources/index.md); Type: string
    
    enum: ["local","xff","cloudflare"]

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
  ```

- 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/settings' \
  -H 'X-API-Key: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "app_unique_identifier": "string",
  "base_url": "https://your.azuracast.site",
  "instance_name": "My AzuraCast Instance",
  "prefer_browser_url": "false",
  "use_radio_proxy": "false",
  "history_keep_days": 0,
  "always_use_ssl": "false",
  "api_access_control": "*",
  "enable_liquidsoap_editing": "true",
  "enable_all_webhooks": "true",
  "filter_local_user_urls": "true",
  "enable_static_nowplaying": "false",
  "analytics": "all",
  "check_for_updates": "true",
  "update_results": "",
  "update_last_run": 1609480800,
  "public_theme": "light",
  "hide_album_art": "false",
  "homepage_redirect_url": "https://example.com/",
  "default_album_art_url": "https://example.com/image.jpg",
  "use_external_album_art_when_processing_media": "false",
  "use_external_album_art_in_apis": "false",
  "last_fm_api_key": "SAMPLE-API-KEY",
  "hide_product_name": "false",
  "public_custom_css": "",
  "public_custom_js": "",
  "internal_custom_css": "",
  "backup_enabled": "false",
  "backup_time_code": 400,
  "backup_exclude_media": "false",
  "backup_keep_copies": 2,
  "backup_storage_location": 1,
  "backup_format": "zip",
  "backup_last_run": 1609480800,
  "backup_last_output": "",
  "setup_complete_time": 1609480800,
  "sync_disabled": "false",
  "sync_last_run": 1609480800,
  "external_ip": "192.168.1.1",
  "geolite_license_key": "",
  "geolite_last_run": 1609480800,
  "mail_enabled": "true",
  "mail_sender_name": "AzuraCast",
  "mail_sender_email": "example@example.com",
  "mail_smtp_host": "smtp.example.com",
  "mail_smtp_port": 465,
  "mail_smtp_username": "username",
  "mail_smtp_password": "password",
  "mail_smtp_secure": "true",
  "avatar_service": "libravatar",
  "avatar_default_url": "",
  "acme_email": "",
  "acme_domains": "",
  "ip_source": "local"
}'
```

### JavaScript

```javascript
const body = `{
  "app_unique_identifier": "string",
  "base_url": "https://your.azuracast.site",
  "instance_name": "My AzuraCast Instance",
  "prefer_browser_url": "false",
  "use_radio_proxy": "false",
  "history_keep_days": 0,
  "always_use_ssl": "false",
  "api_access_control": "*",
  "enable_liquidsoap_editing": "true",
  "enable_all_webhooks": "true",
  "filter_local_user_urls": "true",
  "enable_static_nowplaying": "false",
  "analytics": "all",
  "check_for_updates": "true",
  "update_results": "",
  "update_last_run": 1609480800,
  "public_theme": "light",
  "hide_album_art": "false",
  "homepage_redirect_url": "https://example.com/",
  "default_album_art_url": "https://example.com/image.jpg",
  "use_external_album_art_when_processing_media": "false",
  "use_external_album_art_in_apis": "false",
  "last_fm_api_key": "SAMPLE-API-KEY",
  "hide_product_name": "false",
  "public_custom_css": "",
  "public_custom_js": "",
  "internal_custom_css": "",
  "backup_enabled": "false",
  "backup_time_code": 400,
  "backup_exclude_media": "false",
  "backup_keep_copies": 2,
  "backup_storage_location": 1,
  "backup_format": "zip",
  "backup_last_run": 1609480800,
  "backup_last_output": "",
  "setup_complete_time": 1609480800,
  "sync_disabled": "false",
  "sync_last_run": 1609480800,
  "external_ip": "192.168.1.1",
  "geolite_license_key": "",
  "geolite_last_run": 1609480800,
  "mail_enabled": "true",
  "mail_sender_name": "AzuraCast",
  "mail_sender_email": "example@example.com",
  "mail_smtp_host": "smtp.example.com",
  "mail_smtp_port": 465,
  "mail_smtp_username": "username",
  "mail_smtp_password": "password",
  "mail_smtp_secure": "true",
  "avatar_service": "libravatar",
  "avatar_default_url": "",
  "acme_email": "",
  "acme_domains": "",
  "ip_source": "local"
}`;

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

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

### Python

```python
import requests

body = '''{
  "app_unique_identifier": "string",
  "base_url": "https://your.azuracast.site",
  "instance_name": "My AzuraCast Instance",
  "prefer_browser_url": "false",
  "use_radio_proxy": "false",
  "history_keep_days": 0,
  "always_use_ssl": "false",
  "api_access_control": "*",
  "enable_liquidsoap_editing": "true",
  "enable_all_webhooks": "true",
  "filter_local_user_urls": "true",
  "enable_static_nowplaying": "false",
  "analytics": "all",
  "check_for_updates": "true",
  "update_results": "",
  "update_last_run": 1609480800,
  "public_theme": "light",
  "hide_album_art": "false",
  "homepage_redirect_url": "https://example.com/",
  "default_album_art_url": "https://example.com/image.jpg",
  "use_external_album_art_when_processing_media": "false",
  "use_external_album_art_in_apis": "false",
  "last_fm_api_key": "SAMPLE-API-KEY",
  "hide_product_name": "false",
  "public_custom_css": "",
  "public_custom_js": "",
  "internal_custom_css": "",
  "backup_enabled": "false",
  "backup_time_code": 400,
  "backup_exclude_media": "false",
  "backup_keep_copies": 2,
  "backup_storage_location": 1,
  "backup_format": "zip",
  "backup_last_run": 1609480800,
  "backup_last_output": "",
  "setup_complete_time": 1609480800,
  "sync_disabled": "false",
  "sync_last_run": 1609480800,
  "external_ip": "192.168.1.1",
  "geolite_license_key": "",
  "geolite_last_run": 1609480800,
  "mail_enabled": "true",
  "mail_sender_name": "AzuraCast",
  "mail_sender_email": "example@example.com",
  "mail_smtp_host": "smtp.example.com",
  "mail_smtp_port": 465,
  "mail_smtp_username": "username",
  "mail_smtp_password": "password",
  "mail_smtp_secure": "true",
  "avatar_service": "libravatar",
  "avatar_default_url": "",
  "acme_email": "",
  "acme_domains": "",
  "ip_source": "local"
}'''

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