Skip to Content
Mutation APICollections

Asset Collections

A Collection represents a set of media files grouped by specific attributes and includes all types of assets. It can be a collection of images, videos, documents or audio files.

The Collection object

{ "id": "df7c1544-bad0-4c9d-928f-0c9f684c9ceb", "created_on": "2023-06-13T14:35:54+00:00", "changed_on": "2023-06-13T14:35:54+00:00", "label": "Collection", "body": "Branding & backgrounds" }
FIELDDESCRIPTION
idUnique identifier for each item.
created_onUTC time at which the asset was created/upload.
changed_onUTC time at which the asset was last updated.
labelIdentifier for the object.
bodyName of the collection.

Create, update or destroy

Create a new collection

Use this endpoint to create a collection.

POST https://cdn.prepr.io/collections Authorization: Bearer <YOUR-ACCESS-TOKEN>

Update an existing collection

Use this endpoint to update a collection.

PUT https://cdn.prepr.io/collections/{id} Authorization: Bearer <YOUR-ACCESS-TOKEN>

Destroy an existing collection

Use this endpoint to delete a collection.

DELETE https://cdn.prepr.io/collections/{id} Authorization: Bearer <YOUR-ACCESS-TOKEN>

Managing collections

Add assets to a collection

To add assets to an existing collection, use the example below. This process only adds new assets to the collection. If this collection already has assets, these remain in the collection unchanged and duplicate entries are simply ignored.

POST https://cdn.prepr.io/collections/{id}/assets Authorization: Bearer <YOUR-ACCESS-TOKEN> Content-Type: application/json { "items": [ { "id": "234h-432847-x23498-763x4-324x234" }, { "id": "30f064f4-8acb-4ee9-9e79-81d7029cc0c7" } ] }

Remove assets from a collection

To remove assets from an existing collection, use the example below.

DELETE https://cdn.prepr.io/collections/{id}/assets Authorization: Bearer <YOUR-ACCESS-TOKEN> Content-Type: application/json { "items": [ { "id": "234h-432847-x23498-763x4-324x234" } ] }

Set a collection cover

Use this endpoint to set a collection cover.

POST https://cdn.prepr.io/collections/{id}/cover?id={assetId} Authorization: Bearer <YOUR-ACCESS-TOKEN>

Scopes

collections, collections_publish, collections_delete

Last updated on