# Create a new storage location.

`POST /admin/storage_locations`

Authentication (security requirement alternatives):

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

- ApiKey: apiKey, header X-API-Key

Request body: application/json

Type: object

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

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

  Type: object
  
  - `storageUsedPercent` (optional)
    Type: integer; nullable
    
    Example:
    
    ```json
    "75"
    ```
  
  - `isFull` (optional)
    Type: boolean
    
    Example:
    
    ```json
    "true"
    ```
  
  - `uri` (optional)
    Type: string
    
    The URI associated with the storage location.
    
    Example:
    
    ```json
    "/var/azuracast/www"
    ```
  
  - `stations` (optional)
    Type: array; nullable
    
    The stations using this storage location, if any.
    
    Items:
      Type: string
      
      Example:
      
      ```json
      "AzuraTest Radio"
      ```

Responses:

- 200: Success

Content type: application/json

Type: unknown

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

  Reference: [Api_Admin_StorageLocation](https://sourcey-azuracast.pages.dev/docs/api/models/api-admin-storagelocation/index.md); Type: object

- 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 POST 'https://demo.azuracast.com/api/admin/storage_locations' \
  -H 'X-API-Key: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "storageUsedPercent": "75",
  "isFull": "true",
  "uri": "/var/azuracast/www",
  "stations": [
    "AzuraTest Radio"
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "storageUsedPercent": "75",
  "isFull": "true",
  "uri": "/var/azuracast/www",
  "stations": [
    "AzuraTest Radio"
  ]
}`;

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

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

### Python

```python
import requests

body = '''{
  "storageUsedPercent": "75",
  "isFull": "true",
  "uri": "/var/azuracast/www",
  "stations": [
    "AzuraTest Radio"
  ]
}'''

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