Skip to main content

List collections

Retrieves all voice collections accessible to the authenticated user. Regular users see only their own collections; admin users see all collections.
resource
string
required
voice-collections
action
string
required
all
data
object
The is_featured flag can only be set by admin users (internal_* role). Standard users can filter by isFeatured to browse featured collections, but cannot create or update collections with featured status.
const response = await ApiService.invoke({
  resource: "voice-collections",
  action: "all",
  data: {
    isPublic: true,
    isFeatured: true,
  },
});

Response

collections
VoiceCollection[]
Array of voice collection objects.
count
number
Total number of collections returned.

Get collection

Retrieves a specific voice collection by ID. Users can access their own collections and any public collections. Admin users can access any collection.
resource
string
required
voice-collections
action
string
required
get
id
string
required
The collection ID.
const response = await ApiService.invoke({
  resource: "voice-collections",
  action: "get",
  id: "collection-uuid",
});

Response

collection
VoiceCollection
The requested voice collection object. See VoiceCollection object for field details.

Create collection

Creates a new voice collection. Collections are private and not featured by default.
resource
string
required
voice-collections
action
string
required
create
data
object
required
const response = await ApiService.invoke({
  resource: "voice-collections",
  action: "create",
  data: {
    name: "Customer support voices",
    description: "Professional voices for support genies",
    voice_ids: ["voice-1", "voice-2", "voice-3"],
  },
});

Response (status 201)

collection
VoiceCollection
The newly created voice collection object.

Update collection

Updates an existing voice collection. Users can only update their own collections.
resource
string
required
voice-collections
action
string
required
update
id
string
required
The collection ID to update.
data
object
required
Only admin users can set the is_featured flag. The updated_at timestamp is set automatically.
const response = await ApiService.invoke({
  resource: "voice-collections",
  action: "update",
  id: "collection-uuid",
  data: {
    name: "Updated collection name",
    voice_ids: ["voice-1", "voice-4"],
    is_public: true,
  },
});

Response

collection
VoiceCollection
The updated voice collection object.

Delete collection

Permanently deletes a voice collection. Users can only delete their own collections. Admin users can delete any collection.
resource
string
required
voice-collections
action
string
required
delete
id
string
required
The collection ID to delete.
const response = await ApiService.invoke({
  resource: "voice-collections",
  action: "delete",
  id: "collection-uuid",
});

Response

success
boolean
true if the collection was deleted.
message
string
Confirmation message.
This action is permanent and cannot be undone.