# PlaylistApi

All URIs are relative to *http://localhost:8080/api/v1*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**playlistsGet**](#playlistsget) | **GET** /playlists | Get Playlists|
|[**playlistsIdDelete**](#playlistsiddelete) | **DELETE** /playlists/{id} | Delete Playlist|
|[**playlistsIdGet**](#playlistsidget) | **GET** /playlists/{id} | Get Playlist by ID|
|[**playlistsIdPut**](#playlistsidput) | **PUT** /playlists/{id} | Update Playlist|
|[**playlistsIdTracksPost**](#playlistsidtrackspost) | **POST** /playlists/{id}/tracks | Add Track to Playlist|
|[**playlistsIdTracksReorderPut**](#playlistsidtracksreorderput) | **PUT** /playlists/{id}/tracks/reorder | Reorder Tracks|
|[**playlistsIdTracksTrackIdDelete**](#playlistsidtrackstrackiddelete) | **DELETE** /playlists/{id}/tracks/{trackId} | Remove Track from Playlist|
|[**playlistsPost**](#playlistspost) | **POST** /playlists | Create Playlist|

# **playlistsGet**
> PlaylistsGet200Response playlistsGet()

Get a paginated list of playlists

### Example

```typescript
import {
    PlaylistApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let page: number; //Page number (optional) (default to 1)
let limit: number; //Items per page (optional) (default to 20)
let userId: string; //Filter by User ID (optional) (default to undefined)

const { status, data } = await apiInstance.playlistsGet(
    page,
    limit,
    userId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **limit** | [**number**] | Items per page | (optional) defaults to 20|
| **userId** | [**string**] | Filter by User ID | (optional) defaults to undefined|


### Return type

**PlaylistsGet200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**500** | Internal Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsIdDelete**
> AnalyticsEventsPost200Response playlistsIdDelete()

Permanently delete a playlist

### Example

```typescript
import {
    PlaylistApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let id: string; //Playlist ID (default to undefined)

const { status, data } = await apiInstance.playlistsIdDelete(
    id
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Playlist ID | defaults to undefined|


### Return type

**AnalyticsEventsPost200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Playlist not found |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsIdGet**
> PlaylistsPost201Response playlistsIdGet()

Get detailed information about a playlist

### Example

```typescript
import {
    PlaylistApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let id: string; //Playlist ID (default to undefined)

const { status, data } = await apiInstance.playlistsIdGet(
    id
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Playlist ID | defaults to undefined|


### Return type

**PlaylistsPost201Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Invalid ID |  -  |
|**404** | Playlist not found |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsIdPut**
> PlaylistsPost201Response playlistsIdPut(playlist)

Update playlist metadata

### Example

```typescript
import {
    PlaylistApi,
    Configuration,
    InternalHandlersUpdatePlaylistRequest
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let id: string; //Playlist ID (default to undefined)
let playlist: InternalHandlersUpdatePlaylistRequest; //Playlist Metadata

const { status, data } = await apiInstance.playlistsIdPut(
    id,
    playlist
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **playlist** | **InternalHandlersUpdatePlaylistRequest**| Playlist Metadata | |
| **id** | [**string**] | Playlist ID | defaults to undefined|


### Return type

**PlaylistsPost201Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation Error |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Playlist not found |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsIdTracksPost**
> AnalyticsEventsPost200Response playlistsIdTracksPost(trackId)

Add a track to the playlist

### Example

```typescript
import {
    PlaylistApi,
    Configuration,
    PlaylistsIdTracksPostRequest
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let id: string; //Playlist ID (default to undefined)
let trackId: PlaylistsIdTracksPostRequest; //Track ID (in body)

const { status, data } = await apiInstance.playlistsIdTracksPost(
    id,
    trackId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **trackId** | **PlaylistsIdTracksPostRequest**| Track ID (in body) | |
| **id** | [**string**] | Playlist ID | defaults to undefined|


### Return type

**AnalyticsEventsPost200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Track already present or invalid ID |  -  |
|**404** | Playlist or Track not found |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsIdTracksReorderPut**
> AnalyticsEventsPost200Response playlistsIdTracksReorderPut(order)

Reorder tracks in the playlist

### Example

```typescript
import {
    PlaylistApi,
    Configuration,
    InternalHandlersReorderTracksRequest
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let id: string; //Playlist ID (default to undefined)
let order: InternalHandlersReorderTracksRequest; //New Track Order

const { status, data } = await apiInstance.playlistsIdTracksReorderPut(
    id,
    order
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **order** | **InternalHandlersReorderTracksRequest**| New Track Order | |
| **id** | [**string**] | Playlist ID | defaults to undefined|


### Return type

**AnalyticsEventsPost200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsIdTracksTrackIdDelete**
> AnalyticsEventsPost200Response playlistsIdTracksTrackIdDelete()

Remove a track from the playlist

### Example

```typescript
import {
    PlaylistApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let id: string; //Playlist ID (default to undefined)
let trackId: string; //Track ID (default to undefined)

const { status, data } = await apiInstance.playlistsIdTracksTrackIdDelete(
    id,
    trackId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Playlist ID | defaults to undefined|
| **trackId** | [**string**] | Track ID | defaults to undefined|


### Return type

**AnalyticsEventsPost200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**404** | Playlist or Track not found |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **playlistsPost**
> PlaylistsPost201Response playlistsPost(request)

Create a new playlist

### Example

```typescript
import {
    PlaylistApi,
    Configuration,
    InternalHandlersCreatePlaylistRequest
} from './api';

const configuration = new Configuration();
const apiInstance = new PlaylistApi(configuration);

let request: InternalHandlersCreatePlaylistRequest; //Playlist Metadata

const { status, data } = await apiInstance.playlistsPost(
    request
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **request** | **InternalHandlersCreatePlaylistRequest**| Playlist Metadata | |


### Return type

**PlaylistsPost201Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Created |  -  |
|**400** | Validation Error |  -  |
|**401** | Unauthorized |  -  |
|**500** | Internal Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

