CoreViz
SDK

Collections

List and create collections in your CoreViz workspace

Collections

Collections are the top-level containers for your media in CoreViz. Each collection holds media items and folders organized in a hierarchical structure.

sdk.collections.list()

List all collections in the authenticated user's organization.

Returns: Promise<Collection[]>

const collections = await sdk.collections.list();
// [
//   { id: 'abc123', name: 'Product Photos', icon: '📦', type: 'dataset', organizationId: 'org456' },
//   { id: 'def789', name: 'Campaign 2026', icon: '🎯', type: 'dataset', organizationId: 'org456' }
// ]

Collection Object

FieldTypeDescription
idstringUnique collection identifier
namestringDisplay name
iconstring | undefinedOptional emoji or icon
typestringAlways "dataset"
organizationIdstringOwning organization

sdk.collections.create(name, icon?)

Create a new collection in the authenticated user's organization.

Parameters:

ParameterTypeRequiredDescription
namestringYesCollection display name
iconstringNoOptional emoji or icon name

Returns: Promise<Collection>

const collection = await sdk.collections.create('Spring Campaign', '🌸');
console.log(collection.id); // Use this ID for media.browse(), etc.

REST API Equivalent

These SDK methods call the following endpoints:

SDK MethodHTTPEndpoint
collections.list()GET/api/organization/{orgId}/datasets
collections.create()POST/api/organization/{orgId}/datasets

The orgId is resolved automatically from your token via GET /api/me.

Example — List (curl)

curl https://lab.coreviz.io/api/organization/ORG_ID/datasets \
  -H "Authorization: Bearer YOUR_TOKEN"

Example — Create (curl)

curl -X POST https://lab.coreviz.io/api/organization/ORG_ID/datasets \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Spring Campaign", "icon": "🌸" }'

Next Steps

  • Media: Browse and manage media inside a collection
  • Folders & Tags: Organize media with folders and tag groups