Skip to main content

Replace/Clear Collection

PUT 

/api/v1/assetcollection/:collection_id

Replace assets​

Replace existing assets in a Collection with a new list of assets.

REQUEST PARAMETERS​

ParameterTypeDescription
assetsJSONList of Collection id to be updated

REQUEST JSON​

{
"assets": ["b3ad7854e1ad4ce8a8c83272447f980b"]
}

Clear assets​

Clear all Assets from a Collection by putting an empty list of assets.

REQUEST JSON​

{
"assets": []
}

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. Without expected_revision the write is applied as before.

{
"assets": ["b3ad7854e1ad4ce8a8c83272447f980b"],
"expected_revision": 7
}

HTTP RESPONSE​

ParameterTypeDescription
statusstringOK or ERROR
dataJSONThe updated Collection in Asset Collection JSON format, with its new revision

Request​

Responses​

Successful operation. data is the updated collection, including its new revision.