Groups

A Group is a powerful tool for permissions and user management on Files.com. Users can belong to multiple groups.

All permissions can be managed via Groups, and Groups can also be synced to your identity platform via LDAP or SCIM.

Files.com's Group Admin feature allows you to define Group Admins, who then have access to add and remove users within their groups.

List Groups

SDK Method

group.List()

Return Object

[]*Group

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

GroupListParams Fields

FieldDescription
Ids
string
Comma-separated list of group ids to include in results.
IncludeParentSiteGroups
boolean
Include groups from the parent site.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/group"
)

groupIterator, err := group.List(files_sdk.GroupListParams{IncludeParentSiteGroups: lib.Bool(false)})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for groupIterator.Next() {
    group := groupIterator.group()
}
err = groupIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Show Group

SDK Method

group.Find()

Return Object

Group

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

GroupFindParams Fields

FieldDescription
Id
int64
Required
Group ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/group"
)

group, err := group.Find(files_sdk.GroupFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Create Group

SDK Method

group.Create()

Return Object

Group

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

GroupCreateParams Fields

FieldDefaultDescription
Notes
string
Group notes.
UserIds
string
A list of user ids. If sent as a string, should be comma-delimited.
AdminIds
string
A list of group admin user ids. If sent as a string, should be comma-delimited.
AiAssistantPersonalityId
int64
AI Assistant Personality ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user or Partner assignment overrides it.
FtpPermission
boolean
falseIf true, users in this group can use FTP to login. This will override a false value of ftp_permission on the user level.
SftpPermission
boolean
falseIf true, users in this group can use SFTP to login. This will override a false value of sftp_permission on the user level.
DavPermission
boolean
falseIf true, users in this group can use WebDAV to login. This will override a false value of dav_permission on the user level.
RestapiPermission
boolean
falseIf true, users in this group can use the REST API to login. This will override a false value of restapi_permission on the user level.
DesktopConfigurationProfileId
int64
Desktop Configuration Profile ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user assignment overrides it.
IntegrationCentricProfileId
int64
Integration Centric Profile ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user assignment overrides it.
AllowedIps
string
A list of allowed IPs if applicable. Newline delimited
Name
string
Required
Group name.
WorkspaceId
int64
0Workspace ID

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/group"
)

group, err := group.Create(files_sdk.GroupCreateParams{Name: "name"})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Update Group

SDK Method

group.Update()

Return Object

Group

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

GroupUpdateParams Fields

FieldDescription
Id
int64
Required
Group ID.
Notes
string
Group notes.
UserIds
string
A list of user ids. If sent as a string, should be comma-delimited.
AdminIds
string
A list of group admin user ids. If sent as a string, should be comma-delimited.
AiAssistantPersonalityId
int64
AI Assistant Personality ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user or Partner assignment overrides it.
FtpPermission
boolean
If true, users in this group can use FTP to login. This will override a false value of ftp_permission on the user level.
SftpPermission
boolean
If true, users in this group can use SFTP to login. This will override a false value of sftp_permission on the user level.
DavPermission
boolean
If true, users in this group can use WebDAV to login. This will override a false value of dav_permission on the user level.
RestapiPermission
boolean
If true, users in this group can use the REST API to login. This will override a false value of restapi_permission on the user level.
DesktopConfigurationProfileId
int64
Desktop Configuration Profile ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user assignment overrides it.
IntegrationCentricProfileId
int64
Integration Centric Profile ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user assignment overrides it.
AllowedIps
string
A list of allowed IPs if applicable. Newline delimited
Name
string
Group name.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/group"
)

group, err := group.Update(files_sdk.GroupUpdateParams{
  Id: 1,
  Notes: "example"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Delete Group

SDK Method

group.Delete()

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

GroupDeleteParams Fields

FieldDescription
Id
int64
Required
Group ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/group"
)

err := group.Delete(files_sdk.GroupDeleteParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The Group Object

Some of the methods above return a Group object. The attributes of this object are listed below.

AttributeDescription
Id
int64
Group ID
Name
string
Group name
AllowedIps
string
A list of allowed IPs if applicable. Newline delimited
AdminIds
string
Comma-delimited list of user IDs who are group administrators (separated by commas)
Notes
string
Notes about this group
UserIds
string
Comma-delimited list of user IDs who belong to this group (separated by commas)
Usernames
string
Comma-delimited list of usernames who belong to this group (separated by commas)
AiAssistantPersonalityId
int64
AI Assistant Personality ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user or Partner assignment overrides it.
FtpPermission
boolean
If true, users in this group can use FTP to login. This will override a false value of ftp_permission on the user level.
SftpPermission
boolean
If true, users in this group can use SFTP to login. This will override a false value of sftp_permission on the user level.
DavPermission
boolean
If true, users in this group can use WebDAV to login. This will override a false value of dav_permission on the user level.
RestapiPermission
boolean
If true, users in this group can use the REST API to login. This will override a false value of restapi_permission on the user level.
DesktopConfigurationProfileId
int64
Desktop Configuration Profile ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user assignment overrides it.
IntegrationCentricProfileId
int64
Integration Centric Profile ID assigned to this Group, if any. Users in the Group inherit it unless a direct per-user assignment overrides it.
SiteId
int64
Site ID
WorkspaceId
int64
Workspace ID