# Update details of a single storage location.

`PUT /admin/storage_location/{id}`

Authentication (security requirement alternatives):

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

- ApiKey: apiKey, header X-API-Key

Parameters:

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

Request body: application/json

Type: object

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

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

  Type: object
  
  - `type` (optional)
    Reference: [StorageLocationTypes](https://sourcey-azuracast.pages.dev/docs/api/models/storagelocationtypes/index.md); Type: string
    
    enum: ["backup","station_media","station_recordings","station_podcasts"]
  
  - `adapter` (optional)
    Reference: [StorageLocationAdapters](https://sourcey-azuracast.pages.dev/docs/api/models/storagelocationadapters/index.md); Type: string
    
    enum: ["local","s3","dropbox","sftp"]
  
  - `path` (optional)
    Type: string
    
    The local path, if the local adapter is used, or path prefix for S3/remote adapters.
    
    Example:
    
    ```json
    "/var/azuracast/stations/azuratest_radio/media"
    ```
  
  - `s3CredentialKey` (optional)
    Type: string; nullable
    
    The credential key for S3 adapters.
    
    Example:
    
    ```json
    "your-key-here"
    ```
  
  - `s3CredentialSecret` (optional)
    Type: string; nullable
    
    The credential secret for S3 adapters.
    
    Example:
    
    ```json
    "your-secret-here"
    ```
  
  - `s3Region` (optional)
    Type: string; nullable
    
    The region for S3 adapters.
    
    Example:
    
    ```json
    "your-region"
    ```
  
  - `s3Version` (optional)
    Type: string; nullable
    
    The API version for S3 adapters.
    
    Example:
    
    ```json
    "latest"
    ```
  
  - `s3Bucket` (optional)
    Type: string; nullable
    
    The S3 bucket name for S3 adapters.
    
    Example:
    
    ```json
    "your-bucket-name"
    ```
  
  - `s3Endpoint` (optional)
    Type: string; nullable
    
    The optional custom S3 endpoint S3 adapters.
    
    Example:
    
    ```json
    "https://your-region.digitaloceanspaces.com"
    ```
  
  - `s3UsePathStyle` (optional)
    Type: boolean; nullable
    
    Example:
    
    ```json
    false
    ```
  
  - `dropboxAppKey` (optional)
    Type: string; nullable
    
    The optional Dropbox App Key.
    
    Example:
    
    ```json
    ""
    ```
  
  - `dropboxAppSecret` (optional)
    Type: string; nullable
    
    The optional Dropbox App Secret.
    
    Example:
    
    ```json
    ""
    ```
  
  - `dropboxAuthToken` (optional)
    Type: string; nullable
    
    The optional Dropbox Auth Token.
    
    Example:
    
    ```json
    ""
    ```
  
  - `sftpHost` (optional)
    Type: string; nullable
    
    The host for SFTP adapters
    
    Example:
    
    ```json
    "127.0.0.1"
    ```
  
  - `sftpUsername` (optional)
    Type: string; nullable
    
    The username for SFTP adapters
    
    Example:
    
    ```json
    "root"
    ```
  
  - `sftpPassword` (optional)
    Type: string; nullable
    
    The password for SFTP adapters
    
    Example:
    
    ```json
    "abc123"
    ```
  
  - `sftpPort` (optional)
    Type: integer; nullable
    
    The port for SFTP adapters
    
    Example:
    
    ```json
    20
    ```
  
  - `sftpPrivateKey` (optional)
    Type: string; nullable
    
    The private key for SFTP adapters
  
  - `sftpPrivateKeyPassPhrase` (optional)
    Type: string; nullable
    
    The private key pass phrase for SFTP adapters
  
  - `storageQuotaBytes` (optional)
    Type: unknown; nullable
    
    Example:
    
    ```json
    "120000"
    ```
  
  - `storageQuota` (optional)
    Type: string; nullable
    
    Example:
    
    ```json
    "50 GB"
    ```
  
  - `storageUsedBytes` (optional)
    Type: unknown
    
    Example:
    
    ```json
    "60000"
    ```
  
  - `storageUsed` (optional)
    Type: string
    
    Example:
    
    ```json
    "1 GB"
    ```
  
  - `storageAvailableBytes` (optional)
    Type: unknown; nullable
    
    Example:
    
    ```json
    "120000"
    ```
  
  - `storageAvailable` (optional)
    Type: string
    
    Example:
    
    ```json
    "1 GB"
    ```

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/storage_location/0' \
  -H 'X-API-Key: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "backup",
  "adapter": "local",
  "path": "/var/azuracast/stations/azuratest_radio/media",
  "s3CredentialKey": "your-key-here",
  "s3CredentialSecret": "your-secret-here",
  "s3Region": "your-region",
  "s3Version": "latest",
  "s3Bucket": "your-bucket-name",
  "s3Endpoint": "https://your-region.digitaloceanspaces.com",
  "s3UsePathStyle": false,
  "dropboxAppKey": "",
  "dropboxAppSecret": "",
  "dropboxAuthToken": "",
  "sftpHost": "127.0.0.1",
  "sftpUsername": "root",
  "sftpPassword": "abc123",
  "sftpPort": 20,
  "sftpPrivateKey": "string",
  "sftpPrivateKeyPassPhrase": "string",
  "storageQuotaBytes": "120000",
  "storageQuota": "50 GB",
  "storageUsedBytes": "60000",
  "storageUsed": "1 GB",
  "storageAvailableBytes": "120000",
  "storageAvailable": "1 GB"
}'
```

### JavaScript

```javascript
const body = `{
  "type": "backup",
  "adapter": "local",
  "path": "/var/azuracast/stations/azuratest_radio/media",
  "s3CredentialKey": "your-key-here",
  "s3CredentialSecret": "your-secret-here",
  "s3Region": "your-region",
  "s3Version": "latest",
  "s3Bucket": "your-bucket-name",
  "s3Endpoint": "https://your-region.digitaloceanspaces.com",
  "s3UsePathStyle": false,
  "dropboxAppKey": "",
  "dropboxAppSecret": "",
  "dropboxAuthToken": "",
  "sftpHost": "127.0.0.1",
  "sftpUsername": "root",
  "sftpPassword": "abc123",
  "sftpPort": 20,
  "sftpPrivateKey": "string",
  "sftpPrivateKeyPassPhrase": "string",
  "storageQuotaBytes": "120000",
  "storageQuota": "50 GB",
  "storageUsedBytes": "60000",
  "storageUsed": "1 GB",
  "storageAvailableBytes": "120000",
  "storageAvailable": "1 GB"
}`;

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

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

### Python

```python
import requests

body = '''{
  "type": "backup",
  "adapter": "local",
  "path": "/var/azuracast/stations/azuratest_radio/media",
  "s3CredentialKey": "your-key-here",
  "s3CredentialSecret": "your-secret-here",
  "s3Region": "your-region",
  "s3Version": "latest",
  "s3Bucket": "your-bucket-name",
  "s3Endpoint": "https://your-region.digitaloceanspaces.com",
  "s3UsePathStyle": false,
  "dropboxAppKey": "",
  "dropboxAppSecret": "",
  "dropboxAuthToken": "",
  "sftpHost": "127.0.0.1",
  "sftpUsername": "root",
  "sftpPassword": "abc123",
  "sftpPort": 20,
  "sftpPrivateKey": "string",
  "sftpPrivateKeyPassPhrase": "string",
  "storageQuotaBytes": "120000",
  "storageQuota": "50 GB",
  "storageUsedBytes": "60000",
  "storageUsed": "1 GB",
  "storageAvailableBytes": "120000",
  "storageAvailable": "1 GB"
}'''

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