Skip to main content
Genie groups let you organize your genies into logical categories such as “Sales Team” or “Support Team”. Each group has a name, optional description, and a position for display ordering. Genies can be assigned to a group via the sync action.
Standard users can only manage their own groups. Admin users can manage groups for any user by passing a userId.

List groups

Retrieves all groups for the authenticated user.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "list"
data
object
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke("genie-groups", "list");

Get group

Retrieves a single group by ID.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "get"
id
string
required
The group ID to retrieve (passed as a string).
data
object
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke("genie-groups", "get", "1");

Create group

Creates a new genie group. The group is automatically assigned the next available position.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "create"
data
object
required
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke(
  "genie-groups",
  "create",
  undefined,
  {
    name: "Support Team",
    description: "Genies for support workflows",
  }
);

Update group

Updates an existing group’s properties. Only the fields you provide are changed.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "update"
id
string
required
The group ID to update (passed as a string).
data
object
required
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke("genie-groups", "update", "1", {
  name: "Updated Sales Team",
  description: "Updated description for sales genies",
  position: 2,
});

Delete group

Permanently deletes a group. Genies in the group are not deleted; their group_id is set to null.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "delete"
id
string
required
The group ID to delete (passed as a string).
data
object
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke("genie-groups", "delete", "1");

Reorder groups

Updates the display order of groups based on an ordered array of group IDs. The position of each group is set to its index in the array.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "reorder"
data
object
required
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke(
  "genie-groups",
  "reorder",
  undefined,
  {
    groupIds: [1, 3, 2],
  }
);

Get group genie counts

Returns the number of genies in each group. Useful for displaying counts in group lists without fetching all genies.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "counts"
data
object
success
boolean
Whether the request succeeded.
data
object
const response = await ApiService.invoke("genie-groups", "counts");

Sync genie to group

Assigns or clears a group for a specific genie. Pass a groupId to assign the genie to a group, or pass null to remove the genie from its current group.
resource
string
required
Must be "genie-groups"
action
string
required
Must be "sync"
data
object
required
success
boolean
Whether the request succeeded.
data
object
Use the sync action to move a genie between groups. To transfer a genie from one group to another, simply pass the new groupId — the genie is automatically removed from its previous group. To remove a genie from all groups without assigning a new one, pass groupId: null.
// Assign a genie to a group
const response = await ApiService.invoke(
  "genie-groups",
  "sync",
  undefined,
  {
    agentId: "550e8400-e29b-41d4-a716-446655440000",
    groupId: 2,
  }
);

// Remove a genie from its group
const response = await ApiService.invoke(
  "genie-groups",
  "sync",
  undefined,
  {
    agentId: "550e8400-e29b-41d4-a716-446655440000",
    groupId: null,
  }
);

Error codes

CodeStatusDescription
UNAUTHORIZED401Missing or invalid authentication token
FORBIDDEN403Only admins can manage groups for other users
NOT_FOUND404Group not found
VALIDATION_ERROR400Missing or invalid parameters (for example group ID required)
INTERNAL_ERROR500Server-side error