Managing tracks' crates

If you are managing a big library of tracks, there is a chance you need to group them in some specific way. A possible use-case would be to use the similarity search functionality on a sub-selection of tracks. This is exactly what you can do using our crating features. You can for example create a Customer-XYZ crate and add only tracks that belong to this specific customer of yours to it. Our API allows you to fully automate this process. Below you can find the description of all possible operations.

Creating a Crate#

By default, you can create up to 10 crates. If you need to increase the number, please contact us.

The following mutation allows you to create a crate with a given name:

If the crate was created successfully, you will get a response object containing the id of the crate:

{
"data": {
"crateCreate": {
"__typename": "CrateCreateSuccess",
"id": "1"
}
}
}

Deleting a Crate#

The created crate can be deleted as follows:

If the crate was deleted successfully, the following response will be returned:

{
"data": {
"crateDelete": {
"__typename": "CrateDeleteSuccess"
}
}
}

You can request the current list of your crates using this query:

A result is a connection object containing data about crates.

{
"data": {
"crates": {
"edges": [
{
"node": {
"id": "1",
"name": "example-crate-1"
}
},
{
"node": {
"id": "2",
"name": "example-crate-2"
}
}
]
}
}
}

Add Tracks to a Crate#

You can use Mutation.crateAddLibraryTracks to add up to 1000 tracks to a crate at once.

Every time the crate items are changed, the similarity search for the crate will be updated. This may take some time for the changes to be applied.

To put some tracks into a given crate, follow the example below:

A successful response:

{
"data": {
"crateAddLibraryTracks": {
"__typename": "CrateAddLibraryTracksSuccess"
}
}
}

Removing tracks from crates:

A successful response:

{
"data": {
"crateRemoveLibraryTracks": {
"__typename": "CrateRemoveLibraryTracksSuccess"
}
}
}

Find Similar Library Tracks within a Crate#

One of the main benefits of using crates is being able to request similar tracks from within a specific crate. Below you can see a query, that fetches tracks similar to the track with the given id and returns only results from the given crate.

Example response:

{
"data": {
"libraryTrack": {
"__typename": "LibraryTrack",
"similarLibraryTracks": {
"edges": [
{
"node": {
"id": "1"
}
},
{
"node": {
"id": "2"
}
}
]
}
}
}
}