Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions content/en/docs/Endpoints/createcollection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: "createCollection"
linkTitle: "createCollection [OS]"
categories:
- Collections
opensubsonic:
- Extension
description: >
Creates a collection.
---

`http://your-server/rest/createCollection`

Creates a collection.
This endpoint must be accessed using an HTTP POST request.

### Request Body

The request payload should be provided in the body as a JSON object, as specified by the [CreateCollectionRequest](../payloads/createcollectionrequest) schema.

{{< tabpane persist=false >}}
{{< tab header="CreateCollectionRequest" lang="json">}}
{
"name": "test collection",
"comment": "this is a collection",
"items": [
{
"type": "song",
"id": "300000060"
},
{
"type": "album",
"id": "200000021"
},
{
"type": "genre",
"id": "vaporwave"
}
]
}
{{< /tab >}}
{{< /tabpane >}}
Comment thread
ygabuev marked this conversation as resolved.

### Example request

{{< alert color="primary" >}} `POST http://your-server/rest/createCollection.view?u=demo&p=demo&v=1.16.1&c=AwesomeClientName&f=json` {{< /alert >}}

### Result

A [`subsonic-response`](../../responses/subsonic-response) element with a top-level [`collection`](../../responses/collection) object on success.
In case of an error, a standard HTTP error code is returned with a descriptive message.

{{< tabpane persist=false >}}
Comment thread
ygabuev marked this conversation as resolved.
{{< tab header="**Example**:" disabled=true />}}
{{< tab header="OpenSubsonic" lang="json">}}
{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "AwesomeServerName",
"serverVersion": "0.1.3 (tag)",
"openSubsonic": true,
"collection": {
"id": "800000075",
"name": "test collection",
"comment" "this is a collection",
"owner": "user",
"public": false,
"itemCount": 3,
"created": "2023-03-16T03:18:41+00:00",
"changed": "2023-03-16T03:18:41+00:00"
}
}
}
{{< /tab >}}
{{< /tabpane >}}

| Field | Type | Req. | OpenS. | Details |
| --- | --- | --- | --- | --- |
| `collection` | [`Collection`](../../responses/collection) | **Yes** | | The collection |
42 changes: 42 additions & 0 deletions content/en/docs/Endpoints/deletecollection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: "deleteCollection"
linkTitle: "deleteCollection [OS]"
opensubsonic:
- Extension
categories:
- Collections
description: >
Deletes a collection.
---
`http://your-server/rest/deleteCollection`

Deletes a collection.

### Parameters

| Parameter | Req. | OpenS. | Default | Comment |
| --- | --- | --- | --- | --- |
| `id` | **Yes** | | | ID of the collection to delete, as obtained by `getCollections`. |

### Example

{{< alert color="primary" >}} `http://your-server/rest/deleteCollection.view?id=123&u=demo&p=demo&v=1.13.0&c=AwesomeClientName&f=json` {{< /alert >}}

### Result

An empty [`subsonic-response`](../../responses/subsonic-response) element on success.

{{< tabpane persist=false >}}
{{< tab header="**Example**:" disabled=true />}}
{{< tab header="OpenSubsonic" lang="json">}}
{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "AwesomeServerName",
"serverVersion": "0.1.3 (tag)",
"openSubsonic": true
}
}
{{< /tab >}}
{{< /tabpane >}}
117 changes: 117 additions & 0 deletions content/en/docs/Endpoints/getcollection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: "getCollection"
linkTitle: "getCollection [OS]"
categories:
- Collections
OpenSubsonic:
- Extension
description: >
Returns a collection.
---

`http://your-server/rest/getCollection`

Returns a collection with the items it contains.

### Parameters

| Parameter | Req. | OpenS. | Default | Comment |
| --- | --- | --- | --- | --- |
| `id` | **Yes** | | | ID of the collection to return, as obtained by `getCollections`. |
| `itemCount` | No | | | The number of items from the collection to return. If unset or set to a negative value, return all items. |
| `itemOffset` | No | | | The number of items to skip. |
Comment thread
ygabuev marked this conversation as resolved.

### Example

{{< alert color="primary" >}} `http://your-server/rest/getCollection.view?id=123&u=demo&p=demo&v=1.13.0&c=AwesomeClientName&f=json` {{< /alert >}}

### Result

A [`subsonic-response`](../../responses/subsonic-response) element with a top-level `collection` object of type [collectionWithItems](../../responses/collectionwithitems)

{{< tabpane persist=false >}}
{{< tab header="**Example**:" disabled=true />}}
{{< tab header="OpenSubsonic" lang="json">}}
{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "AwesomeServerName",
"serverVersion": "0.1.3 (tag)",
"openSubsonic": true,
"collection": {
"id": "800000075",
"name": "testcreate",
"comment" "this is a collection",
"owner": "user",
"public": true,
"itemCount": 3,
"created": "2023-03-16T03:18:41+00:00",
"changed": "2023-03-16T03:18:41+00:00",
"items": [
{
"song": {
"id": "300000060",
"parent": "200000002",
"title": "BrownSmoke",
"isDir": false,
"isVideo": false,
"type": "music",
"albumId": "200000002",
"album": "Colorsmoke EP",
"artistId": "100000002",
"artist": "Synthetic",
"coverArt": "300000060",
"duration": 304,
"bitRate": 20,
"bitDepth": 16,
"samplingRate": 44100,
"channelCount": 2,
"userRating": 5,
"averageRating": 5,
"track": 4,
"year": 2007,
"genre": "Electronic",
"size": 792375,
"discNumber": 1,
"suffix": "wma",
"contentType": "audio/x-ms-wma",
"path": "Synthetic/Synthetic_-_Colorsmoke_EP-20k217-2007/04-Synthetic_-_BrownSmokeYSBM20k22khS.wma"
}
},
{
"album": {
"id": "200000021",
"parent": "100000036",
"album": "Forget and Remember",
"title": "Forget and Remember",
"name": "Forget and Remember",
"isDir": true,
"coverArt": "al-200000021",
"songCount": 20,
"created": "2021-07-22T02:09:31+00:00",
"duration": 4248,
"playCount": 0,
"artistId": "100000036",
"artist": "Comfort Fit",
"year": 2005,
"genre": "Hip-Hop"
}
},
{
"genre": {
"value": "vaporwave",
"songCount": 6,
"albumCount": 1
}
}
]
}
}
}
{{< /tab >}}
{{< /tabpane >}}

| Field | Type | Req. | OpenS. | Details |
| --- | --- | --- | --- | --- |
| `collection` | [`collectionWithItems`](../../responses/collectionwithitems) | **Yes** | | The collection |
77 changes: 77 additions & 0 deletions content/en/docs/Endpoints/getcollections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "getCollections"
linkTitle: "getCollections [OS]"
OpenSubsonic:
- Extension
categories:
- Collections
description: >
Returns collections a user has access to.
---

`http://your-server/rest/getCollections`

Returns collections a user has access to, with optional filters and pagination.

### Parameters

| Parameter | Req. | OpenS. | Default | Comment |
| --- | --- | --- | --- | --- |
| `username` | No | | | If specified, return collections for this user rather than for the authenticated user. The authenticated user must have admin role if this parameter is used. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any plans to add pagination, filters, and/or search? If a user makes a large number of collections, it could be messy with no pagination options.
If pagination is offered, should probably include a total count in the response.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the pagination, but not sure about filtering and search at this point. Looks like the search3 endpoint would be a natural place to use, WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't talk about search3 :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welp 🤷

Then what is the current state of search in the community?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to be defined, but it's per endpoint with filtering and ordering as kgarner said we also need to define field selections.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a simple filter by name and sorting.

| `name` | No | | | If specified, return collections that have the provided string in their name. |
| `sort` | No | | name | If specified, sort the list by the provided field or randomly. Sorting is applied before the `count` and `offset` parameters are taken into account. The default is to sort by name. Allowed values: name, created, random. |
| `order` | No | | asc | The order of sorting. Allowed values: asc, desc. |
| `count` | No | | | The number of collections to return. If unset or set to a negative value, return all collections. |
| `offset` | No | | | The number of collections to skip. |

### Example

{{< alert color="primary" >}} `http://your-server/rest/getCollections.view?count=2&u=demo&p=demo&v=1.13.0&c=AwesomeClientName&f=json` {{< /alert >}}

### Result

A [`subsonic-response`](../../responses/subsonic-response) element with a top-level `collections` array of [collection](../../responses/collection) elements on success.

{{< tabpane persist=false >}}
{{< tab header="**Example**:" disabled=true />}}
{{< tab header="OpenSubsonic" lang="json">}}
{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "AwesomeServerName",
"serverVersion": "0.1.3 (tag)",
"openSubsonic": true,
"collections": [
{
"id": "800000075",
"name": "testcollection",
"owner": "user",
"public": true,
"created": "2026-03-16T03:18:41+00:00",
"changed": "2026-03-16T03:18:41+00:00",
"itemCount": 3,
"readonly": true
},
{
"id": "800000076",
"name": "testcollection2",
"comment" "this is another collection",
"owner": "user",
"public": false,
"itemCount": 17,
"created": "2026-03-16T03:18:41+00:00",
"changed": "2026-03-16T03:18:41+00:00",
"readonly": true
}
],
"totalCount": 10
}
}
{{< /tab >}}
{{< /tabpane >}}

| Field | Type | Req. | OpenS. | Details |
| --- | --- | --- | --- | --- |
| `collections` | Array of [`collection`](../../responses/collection) | **Yes** | | The collections. |
| `totalCount` | integer | **Yes** | | The total number of collections a user has access to. |
Loading