Skip to main content

Update Collection

PATCH 

/api/v1/assetcollection/:collection_id

Update a Collection with partial data. At least one of name, description, group_access, additions, deletions, or source_id must be provided.

Note: The default Basket collection (SELECTED_ASSETS) cannot have its name, description, or group access updated.

REQUEST PARAMETERS​

ParameterTypeDescription
namestring(optional) New collection name
descriptionstring(optional) New collection description
group_accessboolean(optional) true to share with group, false for private
additionsarray(optional) List of asset IDs to add to the collection
deletionsarray(optional) List of asset IDs to remove from the collection
source_idinteger(optional) Collection ID whose assets will be merged into additions
expected_revisioninteger(optional) The collection's revision as you read it. If it changed since, the update is refused with 409 and nothing is written

REQUEST JSON​

{
"name": "Updated Collection Name",
"description": "New description",
"group_access": true,
"additions": ["b3ad7854e1ad4ce8a8c83272447f980b"],
"deletions": ["caf2b5f2e80a40729e32489ee65ef0d8"],
"expected_revision": 7
}

Refusing stale writes​

Send expected_revision with the revision you read from Get Collection. If the collection changed since, nothing is written and the response is 409 with "error": "stale_revision" and the collection's current_revision: read it again, re-apply your change and retry. A successful update returns the collection with its new revision, so you can chain another checked update without reading it again.

Without expected_revision the update is applied as before. expected_revision needs a single collection ID in the URL: a batch update of several collections (ids) cannot carry it and is refused with 400. See Retries and conflicts.

HTTP RESPONSE​

ParameterTypeDescription
statusstringOK or ERROR
dataJSONCollection in Asset Collection JSON format

Response JSON​

{
"status": "OK",
"data": {
"id": 21,
"user_id": 45,
"name": "Updated Collection Name",
"description": "New description",
"last_update": "2025-01-24T09:11:05Z",
"assets": ["b3ad7854e1ad4ce8a8c83272447f980b"],
"group_access": true,
"user_name": "John Doe",
"user_email": "john@example.org",
"revision": 8,
"extended_result": {}
}
}

Request​

Responses​

Successful operation