Skip to main content
Slices allow you to create curated subsets of your datasets with specific selection criteria.

Slices

List slices

Retrieve a paginated list of slices for a specific owner.
await avala.slices.list(owner, options?)
owner
string
required
The owner (username or organization slug) of the slices.
options
object
Optional parameters for pagination.
limit
number
Maximum number of slices to return per page.
cursor
string
Cursor for pagination to fetch the next page of results.
items
Slice[]
Array of slice objects.
uid
string
Unique identifier for the slice.
name
string
Name of the slice.
slug
string | null
URL-friendly slug for the slice.
ownerName
string | null
Name of the slice owner.
organization
object | null
Organization details if the slice belongs to an organization.
visibility
string | null
Visibility setting for the slice (e.g., public, private).
status
string | null
Current status of the slice.
itemCount
number | null
Number of items in the slice.
subSlices
object[] | null
Array of sub-slice configurations.
URLs of featured items from the slice.
nextCursor
string | null
Cursor for the next page of results.
previousCursor
string | null
Cursor for the previous page of results.
hasMore
boolean
Whether there are more results available.

Get slice

Retrieve a specific slice by owner and slug.
await avala.slices.get(owner, slug)
owner
string
required
The owner (username or organization slug) of the slice.
slug
string
required
The slug of the slice to retrieve.

Create slice

Create a new slice with specific selection criteria.
await avala.slices.create(options)
options
object
required
name
string
required
Name of the slice.
visibility
string
required
Visibility setting for the slice (e.g., “public”, “private”).
subSlices
Array<object>
required
Array of sub-slice configurations that define the selection criteria.
organization
string
Organization slug if creating the slice under an organization.
randomSelectionCount
number
Number of items to randomly select for the slice.

Slice items

List slice items

Retrieve a paginated list of items in a slice.
await avala.slices.listItems(owner, slug, options?)
owner
string
required
The owner (username or organization slug) of the slice.
slug
string
required
The slug of the slice.
options
object
Optional parameters for pagination.
limit
number
Maximum number of items to return per page.
cursor
string
Cursor for pagination to fetch the next page of results.
items
SliceItem[]
Array of slice item objects.
uid
string
Unique identifier for the item.
id
number | null
Numeric ID of the item.
key
string | null
Key identifier for the item.
dataset
string | null
Dataset UID that the item belongs to.
url
string | null
URL to access the item.
gpuTextureUrl
string | null
GPU texture URL for optimized rendering.
thumbnails
string[] | null
Array of thumbnail URLs.
videoThumbnail
string | null
Video thumbnail URL if the item is a video.
metadata
object | null
Additional metadata associated with the item.
annotations
object | null
Annotation data for the item.
cropData
object | null
Crop data for the item.
Array of related items.
UID of related sequence if applicable.
createdAt
string | null
Timestamp when the item was created.
updatedAt
string | null
Timestamp when the item was last updated.
nextCursor
string | null
Cursor for the next page of results.
previousCursor
string | null
Cursor for the previous page of results.
hasMore
boolean
Whether there are more results available.

Get slice item

Retrieve a specific item from a slice.
await avala.slices.getItem(owner, slug, itemUid)
owner
string
required
The owner (username or organization slug) of the slice.
slug
string
required
The slug of the slice.
itemUid
string
required
The unique identifier of the item to retrieve.

Build docs developers (and LLMs) love