Skip to content
Get started

Add

collections.assets.add(strcollection_id, AssetAddParams**kwargs) -> AssetAddResponse
PUT/collections/{collectionId}/assets

Add assets to a specific collection

ParametersExpand Collapse
collection_id: str
asset_ids: Sequence[str]

The ids of the assets to add to the collection. (Max 49 at once)

ReturnsExpand Collapse
class AssetAddResponse:
collection: Collection
id: str

The collection ID (example: “asset_GTrL3mq4SXWyMxkOHRxlpw”)

asset_count: float
created_at: str

The collection creation date as an ISO string (example: “2023-02-03T11:19:41.579Z”)

item_count: float
model_count: float
name: str

The collection name

owner_id: str

The owner ID (example: “dcf121faaa1a0a0bbbd9ca1b73d62aea”)

updated_at: str

The collection last update date as an ISO string (example: “2023-02-03T11:19:41.579Z”)

thumbnail: Optional[CollectionThumbnail]

The thumbnail for the collection (if any)

asset_id: str
url: str

Add

import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
response = client.collections.assets.add(
    collection_id="collectionId",
    asset_ids=["string"],
)
print(response.collection)
{
  "collection": {
    "id": "id",
    "assetCount": 0,
    "createdAt": "createdAt",
    "itemCount": 0,
    "modelCount": 0,
    "name": "name",
    "ownerId": "ownerId",
    "updatedAt": "updatedAt",
    "thumbnail": {
      "assetId": "assetId",
      "url": "url"
    }
  }
}
Returns Examples
{
  "collection": {
    "id": "id",
    "assetCount": 0,
    "createdAt": "createdAt",
    "itemCount": 0,
    "modelCount": 0,
    "name": "name",
    "ownerId": "ownerId",
    "updatedAt": "updatedAt",
    "thumbnail": {
      "assetId": "assetId",
      "url": "url"
    }
  }
}