Skip to content

Change asset membership in a collection

Request

Add assets to a collection or remove them from it. The response contains the outcome for each item, keyed by the supplied batch item ID. An asset already in the requested state counts as a success.

Security
bearerToken
Bodyapplication/jsonrequired
collectionIdstring, non-emptyrequired

The ID of the collection to update

operationstringrequired

Whether to add the assets to the collection or remove them from it

Enum:"ADD""REMOVE"
itemsArray of objects, [ 1 .. 500 ] itemsrequired

Assets to add or remove. Each item must have a distinct batchItemId.

curl -i -X POST \
  https://api-v2.dash.app/collection-asset-membership-batches \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "collectionId": "string",
    "operation": "ADD",
    "items": [
      {
        "batchItemId": "string",
        "assetId": "string"
      }
    ]
  }'

Responses

Success

Bodyapplication/json
successesobjectrequired

Successful asset IDs keyed by the batchItemId provided in the request

failuresobjectrequired

Failures keyed by the batchItemId provided in the request

Response
{ "successes": { "property1": "string", "property2": "string" }, "failures": { "property1": "MEMBERSHIP_CHANGE_FAILED", "property2": "MEMBERSHIP_CHANGE_FAILED" } }