Skip to content
Skip to main content

How Agent Account workspaces work

Last updated:

A workspace groups the Agent Accounts in your application by a shared attribute, usually their email domain, and carries the policy and rules that govern every account inside it. Instead of setting limits and mail filtering on each grant one at a time, you configure them once on the workspace and every member inherits them. This page covers how workspaces work, how to create one, and how accounts get assigned.

A workspace is a container that groups Agent Accounts and holds one policy_id plus an array of rule_ids. Every account in the workspace inherits that policy’s limits and spam settings, and runs the workspace’s rules on its mail. The policy sets send caps (for example, 200 messages per account per day on the free plan), storage, and retention.

The pieces form a chain. A policy bundles limits and spam detection, rules describe match conditions and actions, and a workspace references one policy and a list of rules. A grant carries a workspace_id that points at its workspace, so changing the workspace’s policy reconfigures every account in it at once.

Create a workspace with a POST /v3/workspaces request. You can set 5 fields: name, domain, auto_group, policy_id, and rule_ids. The domain ties the workspace to one email domain, and auto_group controls whether matching accounts join it automatically. The response returns the workspace_id you store on grants.

A workspace with no policy_id runs its accounts at your billing plan’s maximum limits, so you can create the grouping first and attach a policy later. To attach or change the policy, see Attach a policy to a workspace.

Every new Agent Account goes through a three-step decision to find its workspace:

  1. Explicit assignment — if you pass a workspace_id in the POST /v3/connect/custom payload, the grant joins that workspace immediately.
  2. Domain auto-group — if no workspace_id is given, Nylas checks whether a custom workspace exists whose domain matches the grant’s email domain and whose auto_group is true. If one matches, the grant joins it.
  3. Default workspace — if neither condition above applies, the grant lands in the application’s default workspace.

To move a grant after it has been created, use PATCH /v3/grants/{grant_id} with a new workspace_id, or use the manual-assign endpoint to reassign up to 500 grants at a time.

The Update Workspace Assignments endpoint, POST /v3/workspaces/{workspace_id}/manual-assign, adds or removes specific grants from a workspace whose auto_group is false. Send grant IDs in assign_grants, remove_grants, or both, with up to 500 IDs per list.

To sort existing grants in bulk by domain, use the Automatically Group Grants endpoint, which runs a background job and creates domain workspaces as needed.

Every application has exactly one default workspace that Nylas creates automatically when the application is provisioned. The application object exposes its ID as default_workspace_id (a UUID string). Any grant that isn’t explicitly assigned or domain auto-grouped lands here.

The default workspace is protected. You can update only policy_id and rule_ids on it — name, domain, and auto_group are locked and return an error if you try to change them. You can’t delete the default workspace.

Both default and non-default workspaces can have a policy and rules assigned, updated, or removed. Use PATCH /v3/workspaces/{workspace_id} and include only the fields you want to change:

  • Omit a field — no change to the current value.
  • Set a field to a value — overwrites the current value. policy_id takes a single UUID string; rule_ids takes an array of UUID strings.
  • Set a field to null — clears the value. Setting policy_id: null detaches the policy; setting rule_ids: null removes all rules.

A workspace with no policy_id runs its accounts at your billing plan’s maximum limits. Attaching a policy narrows those limits to whatever the policy defines.

Default workspaceNon-default workspace
domainLockedLocked after creation
nameLockedUpdatable
auto_groupLockedUpdatable
policy_idUpdatable (single UUID or null)Updatable (single UUID or null)
rule_idsUpdatable (UUID array or null)Updatable (UUID array or null)
DeleteNot allowedAllowed

Manual assignment via POST /v3/workspaces/{workspace_id}/manual-assign works only when the workspace’s auto_group is false.

Plan your workspace structure early. A workspace’s domain can’t change after creation, so decide which domains map to which workspaces before you start provisioning accounts. Use one workspace per agent archetype — a sales-outreach group and a support-triage group have different send limits and spam tolerances.