Workspaces

A Workspace is a lightweight way to organize related resources inside a single Files.com Site.

Customers commonly group resources by project, department, client, or region. Workspaces provide a built-in structure for that grouping, so the UI can operate within a clear “workspace context” and admins can delegate management for a subset of resources without requiring full site-level isolation.

Every Site has an implicit Default workspace (ID 0). Resources that are not explicitly assigned to a named workspace are considered part of the Default workspace.

List Workspaces

SDK Function

Workspace.list()

Return Object

ListIterator<Workspace>

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Workspace;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<Workspace> workspaces = Workspace.list(parameters);
  for (Workspace workspace : workspaces.listAutoPaging()) {
    // Operate on workspace
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show Workspace

SDK Function

Workspace.find()

Return Object

Workspace

Authorization Requirement

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

Function Arguments

ArgumentDescription
id
int64
Required
Workspace ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Workspace;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  Workspace workspace = Workspace.find(id, parameters);
  // Operate on workspace
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Create Workspace

SDK Function

Workspace.create()

Return Object

Workspace

Authorization Requirement

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

Function Arguments

ArgumentDescription
name
string
Workspace name

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Workspace;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Project Alpha");
  
  Workspace workspace = Workspace.create(parameters);
  // Operate on workspace
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Update Workspace

SDK Function

workspace.update();

Return Object

Workspace

Authorization Requirement

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

Attribute Setters

SetterDescription
setName
string
Workspace name

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Workspace;

try {
  // Find the workspace object by its id.
  Workspace workspace = Workspace.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Project Alpha");
  workspace.update(parameters);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Delete Workspace

SDK Function

workspace.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.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Workspace;

try {
  // Find the workspace object by its id.
  Workspace workspace = Workspace.find(id, null);
  workspace.delete(null);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The Workspace Object

Some of the functions above return a Workspace object. The attributes of this object are listed below.

AttributeDescription
id
int64
Workspace ID
name
string
Workspace name