# Create a new Streamer/DJ account.

`POST /station/{station_id}/streamers`

Authentication (security requirement alternatives):

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

- ApiKey: apiKey, header X-API-Key

Parameters:

- `station_id` (path, unknown, required)
  Type: unknown
  
  anyOf:
    Type: integer, int64
  
    Type: string, string

Request body: application/json

Type: object

Station streamers (DJ accounts) allowed to broadcast to a station.

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

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

  Type: object
  
  - `streamer_username` (optional)
    Type: string
    
    Example:
    
    ```json
    "dj_test"
    ```
  
  - `streamer_password` (optional)
    Type: string
    
    Example:
    
    ```json
    ""
    ```
  
  - `display_name` (optional)
    Type: string
    
    Example:
    
    ```json
    "Test DJ"
    ```
  
  - `comments` (optional)
    Type: string; nullable
    
    Example:
    
    ```json
    "This is a test DJ account."
    ```
  
  - `is_active` (optional)
    Type: boolean
    
    Example:
    
    ```json
    true
    ```
  
  - `enforce_schedule` (optional)
    Type: boolean
    
    Example:
    
    ```json
    false
    ```
  
  - `reactivate_at` (optional)
    Type: integer; nullable
    
    Example:
    
    ```json
    1609480800
    ```
  
  - `schedule_items` (optional)
    Type: array
    
    Items:
      Type: unknown

Responses:

- 200: Success

Content type: application/json

Type: object

Station streamers (DJ accounts) allowed to broadcast to a station.

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

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

  Type: object
  
  - `streamer_username` (optional)
    Type: string
    
    Example:
    
    ```json
    "dj_test"
    ```
  
  - `streamer_password` (optional)
    Type: string
    
    Example:
    
    ```json
    ""
    ```
  
  - `display_name` (optional)
    Type: string
    
    Example:
    
    ```json
    "Test DJ"
    ```
  
  - `comments` (optional)
    Type: string; nullable
    
    Example:
    
    ```json
    "This is a test DJ account."
    ```
  
  - `is_active` (optional)
    Type: boolean
    
    Example:
    
    ```json
    true
    ```
  
  - `enforce_schedule` (optional)
    Type: boolean
    
    Example:
    
    ```json
    false
    ```
  
  - `reactivate_at` (optional)
    Type: integer; nullable
    
    Example:
    
    ```json
    1609480800
    ```
  
  - `schedule_items` (optional)
    Type: array
    
    Items:
      Type: unknown

- 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 POST 'https://demo.azuracast.com/api/station/0/streamers' \
  -H 'X-API-Key: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "streamer_username": "dj_test",
  "streamer_password": "",
  "display_name": "Test DJ",
  "comments": "This is a test DJ account.",
  "is_active": true,
  "enforce_schedule": false,
  "reactivate_at": 1609480800,
  "schedule_items": []
}'
```

### JavaScript

```javascript
const body = `{
  "streamer_username": "dj_test",
  "streamer_password": "",
  "display_name": "Test DJ",
  "comments": "This is a test DJ account.",
  "is_active": true,
  "enforce_schedule": false,
  "reactivate_at": 1609480800,
  "schedule_items": []
}`;

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

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

### Python

```python
import requests

body = '''{
  "streamer_username": "dj_test",
  "streamer_password": "",
  "display_name": "Test DJ",
  "comments": "This is a test DJ account.",
  "is_active": true,
  "enforce_schedule": false,
  "reactivate_at": 1609480800,
  "schedule_items": []
}'''

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