Workspaces
Workspaces group and organize grants in a Nylas application by a common attribute, such as the email address domain (for example, nylas.com).
Assign grants to workspaces
Nylas offers two endpoints to manage workspaces and the grants they contain:
- Automatically Group Grants into Workspaces: Starts a background job that, based on your filters, processes existing grants in your Nylas application and automatically sorts them to existing workspaces. If necessary, Nylas automatically creates new workspaces.
- Update Workspace Assignments: Manually specify a workspace ID and up to 500 grants to add or remove from that workspace.
Default workspace
A Nylas application can have a default workspace, which Nylas creates automatically when the application is created and manages on your behalf. Applications created before default workspaces were introduced might not have one. When you retrieve workspaces, Nylas identifies the default workspace with "default": true, and the application object exposes its ID as default_workspace_id.
When a new grant is created without an explicit workspace_id, Nylas first tries to auto-group it into a workspace that has auto_group enabled and a domain that matches the grant's email address domain. If no domain workspace matches, Nylas assigns the grant to the application's default workspace, if one exists.
The default workspace is protected: you can update only its policy_id and rule_ids values (changes to name or auto_group return an error), and you can't delete it. A workspace's domain can't be changed after creation, on any workspace.
Policies and rules
Workspaces can carry a policy (policy_id) and rules (rule_ids). Agent Accounts in a workspace use the policy attached to the workspace for limits and spam settings, and the rules attached to the workspace for mail filtering.
Workspace limitations
- Workspaces are designed to group grants by the top-level domain (TLD) of users' email addresses. Nylas allows you to manually assign grants to any workspace, but that workspace must have
auto_groupset tofalse. - When
auto_groupis set tofalse, Nylas doesn't automatically assign grants to that workspace. You'll need to manually assign grants to the workspace using the Update Workspace Assignments endpoint. - When
auto_groupistrue, Nylas automatically assigns new grants to the workspace. You can move grants to a different workspace by making an Update Workspace Assignments request.
GET /v3/workspacesReturns all workspaces in your Nylas application. The application queried is determined based on the API key you use to authorize your request.
POST /v3/workspacesCreates a workspace.
GET /v3/workspaces/{workspace_id}Returns the specified workspace.
PATCH /v3/workspaces/{workspace_id}Updates the specified workspace. You cannot change a workspace's domain after it's created. On the application's default workspace, you can update only the policy id and rule ids values.
DELETE /v3/workspaces/{workspace_id}Deletes the specified workspace. You can't delete the application's default workspace. The workspace's grants keep working and move to the default workspace, or become unassigned if there isn't one. T...
POST /v3/workspaces/auto-groupConfigures automatic grouping settings for new or existing workspaces, depending on the filters set. If you don't set any filters, Nylas considers all grants.
POST /v3/workspaces/{workspace_id}/manual-assignManually assigns or removes specified grants to or from a specific workspace. You must specify at least one grant ID in either assign grants or remove grants. You can include up to 500 grants per list...