User Groups

API for user groups (workspaces)

User Groups (also known as Workspaces) enable teams to collaborate by sharing resources such as flows, data stores, and files. All resources are owned by the group rather than individual users, while maintaining audit trails for individual user actions.

Overview

  • All group resources are shared among group members

  • Individual user actions are tracked in audit logs

  • Admin users are automatically added to the "admin" user group

  • Users can switch between personal and group contexts

  • JWT tokens include group information for proper authorization

Create User Group

POST https://api.YOUR_TENANT.appmixer.cloud/user-groups

Create a new user group. Admin token required.

curl -XPOST "https://api.appmixer.com/user-groups" \
  -H "Authorization: Bearer [ADMIN_TOKEN]" \
  -H "Content-type: application/json" \
  -d '{ "name": "Marketing Team", "metadata": { "department": "marketing" } }'

Request Body

Name
Type
Description

name*

string

Name of the user group

metadata

object

Optional metadata for the group

List User Groups

GET https://api.YOUR_TENANT.appmixer.cloud/user-groups

List all user groups. Admin users see all groups, regular users see only their own groups.

Get User Group

GET https://api.YOUR_TENANT.appmixer.cloud/user-groups/:groupId

Get details of a specific user group. Users can only access groups they belong to, admins can access all groups.

Update User Group

PUT https://api.YOUR_TENANT.appmixer.cloud/user-groups/:groupId

Update user group details. Admin token required.

Request Body

Name
Type
Description

name

string

Updated name of the group

metadata

object

Updated metadata (replaces existing)

Delete User Group

DELETE https://api.YOUR_TENANT.appmixer.cloud/user-groups/:groupId

Delete a user group. Admin token required. This will remove the group and revoke all group member access to shared resources.

Add Group Members

POST https://api.YOUR_TENANT.appmixer.cloud/user-groups/:groupId/members

Add one or more members to a user group. Admin token required.

Request Body

Name
Type
Description

userIds*

string[]

Array of user IDs to add

Remove Group Member

DELETE https://api.YOUR_TENANT.appmixer.cloud/user-groups/:groupId/members/:userId

Remove a member from a user group. Admin token required. This will revoke all issued tokens for the removed user in this group context.

Get Group Members

GET https://api.YOUR_TENANT.appmixer.cloud/user-groups/:groupId/members

Get all members of a user group. Users can only access groups they belong to, admins can access all groups.

List User's Groups

GET https://api.YOUR_TENANT.appmixer.cloud/users/:userId/groups

Get all groups that a specific user belongs to.

Switch Context

POST https://api.YOUR_TENANT.appmixer.cloud/auth/switch-context

Switch user context between personal workspace and a group workspace. Returns a new JWT token with the selected context.

Request Body

Name
Type
Description

groupId

string

Group ID to switch to, or null/omit to switch to personal context

JWT Token Structure with Groups

When operating in a group context, the JWT token includes:

  • id: The group user ID (resources are owned by this ID)

  • originalUserId: The actual user ID (for audit logging)

  • groups: Array of group IDs the user belongs to

This ensures proper resource ownership while maintaining audit trails.

Get Available Contexts

GET https://api.YOUR_TENANT.appmixer.cloud/auth/available-contexts

List all available contexts (personal and groups) that the current user can switch to.

Use Cases

Collaborative Teams

User groups are ideal for teams that need to collaborate on integrations and automations:

  1. Create a group for your team (e.g., "Marketing Team")

  2. Add team members to the group

  3. Members switch context to the group workspace

  4. All resources (flows, accounts, data stores) are now shared among team members

  5. Audit logs maintain individual user accountability

Admin Group

When a user is assigned the admin scope, they are automatically added to the default "Admin Group". This enables:

  • Shared access to all integration templates

  • Collaborative administration of the Appmixer instance

  • Shared ownership of admin-created resources

SSO Integration

User groups work with SSO (Single Sign-On) authentication:

  • JWT tokens from SSO providers should include a groups claim

  • Users are automatically assigned to groups based on the SSO groups claim

  • Tokens are refreshed correctly to maintain group membership

Important Notes

Audit Trail

All actions performed by users in a group context are logged with the original user ID, ensuring full audit trail capability even when resources are shared.

Resource Ownership

When operating in a group context:

  • All created resources (flows, accounts, data stores, files) are owned by the group user ID

  • All group members have equal access to these resources

  • Switching back to personal context shows only personally-owned resources

Last updated

Was this helpful?