List Workspaces

Retrieve workspaces in an organization with filtering, sorting, and pagination using the workspaceList query.


Use the workspaceList query to retrieve the workspaces in one or more organizations, with filtering, sorting, and pagination. Workspaces are Workspace objects in the API, and an organization is an Organization. By default workspaceList returns the workspaces the authenticated user is a member of; organization owners can also list workspaces they are not in (see Permissions).

Request

The smallest call passes the organizations to search in via the required companyIds filter. Each entry is an organization ID or slug.

query ListWorkspaces {
  workspaceList(filter: { companyIds: ["company_123"] }) {
    items {
      id
      name
      slug
      archived
    }
    pageInfo {
      totalItems
      hasNextPage
    }
  }
}

Parameters

workspaceList takes a required filter, plus optional sort, skip, and take.

ArgumentTypeDefaultDescription
filterProjectListFilter!Which workspaces to return. See below.
sort[ProjectSort!]Sort order. Multiple keys are applied in order.
skipInt0Number of workspaces to skip (offset).
takeInt20Number of workspaces to return (page size).
Deprecated arguments

orderBy, after, before, first, and last are deprecated. Use sort for ordering and skip/take for pagination.

ProjectListFilter

FieldTypeRequiredDescription
companyIds[String!]!YesOrganization IDs or slugs to search within.
ids[String!]NoReturn only the workspaces with these IDs.
archivedBooleanNoFilter by archived status.
isTemplateBooleanNoFilter by template status.
searchStringNoMatch workspaces whose name contains this substring (case-insensitive).
folderIdStringNoReturn only workspaces in this folder. Pass null for root-level workspaces (those not in any folder).
inProjectBooleanNoMembership scope. See the note below.
userIds[String!]NoReturn only workspaces where every listed user is a member. Also populates Workspace.members with the matching members.

inProject membership scope

  • true or omitted: return workspaces the authenticated user is a member of.
  • false: return workspaces the user is not a member of. Requires the user to be an owner of at least one of the supplied organizations, otherwise the query throws FORBIDDEN.

ProjectSort

ValueDescription
id_ASC / id_DESCSort by ID.
name_ASC / name_DESCSort by name (A–Z / Z–A).
createdAt_ASC / createdAt_DESCSort by creation date.
updatedAt_ASC / updatedAt_DESCSort by last update.
position_ASC / position_DESCSort by the user’s manual ordering. Only honored when listing the user’s own workspaces — see the note below.

Response

workspaceList returns a ProjectPagination: the matched workspaces in items, page metadata in pageInfo, and the total match count in totalCount (a sibling of pageInfo, not a field inside it).

{
  "data": {
    "workspaceList": {
      "items": [
        {
          "id": "clm4n8qwx000008l0g4oxdqn7",
          "name": "Marketing Campaigns",
          "slug": "marketing-campaigns",
          "archived": false
        },
        {
          "id": "clm4n9b2y000108l0a1b2c3d4",
          "name": "Product Roadmap",
          "slug": "product-roadmap",
          "archived": false
        }
      ],
      "pageInfo": {
        "totalItems": 2,
        "hasNextPage": false
      }
    }
  }
}

ProjectPagination

FieldTypeDescription
items[Workspace!]!The workspaces on this page.
pageInfoPageInfo!Pagination metadata.
totalCountIntTotal number of workspaces matching the filter, across all pages.

PageInfo

FieldTypeDescription
totalItemsIntTotal workspaces matching the filter.
totalPagesIntTotal number of pages at the current take.
pageIntCurrent page number.
perPageIntPage size (mirrors take).
hasNextPageBoolean!Whether another page follows.
hasPreviousPageBoolean!Whether a previous page exists.

Workspace fields

Each entry in items is a Workspace. Commonly requested fields are below; request any combination your integration needs.

FieldTypeDescription
idID!Unique identifier.
uidString!Short unique identifier.
slugString!URL-friendly identifier.
nameString!Display name.
descriptionStringWorkspace description.
archivedBooleanWhether the workspace is archived.
colorStringDisplay color.
iconStringDisplay icon.
imageImageCover image object.
categoryProjectCategory!Workspace category (e.g. MARKETING, ENGINEERING, GENERAL).
createdAtDateTime!When the workspace was created.
updatedAtDateTime!When the workspace was last updated.
lastAccessedAtDateTimeWhen the user last opened the workspace.
positionFloat!The user’s manual ordering position.
allowNotificationBoolean!Whether notifications are enabled.
unseenActivityCountInt!Number of unseen activity items.
isTemplateBoolean!Whether this workspace is a template.
isOfficialTemplateBoolean!Whether this is an official Blue template.
automationsCount(isActive: Boolean)Int!Number of automations; pass isActive to count only active (or inactive) ones.
totalFileCountIntNumber of files in the workspace.
totalFileSizeFloatCombined size of all files, in bytes.
todoAliasStringCustom label used in place of “record” in this workspace.
organizationOrganization!The organization that owns the workspace.
folderFolderThe folder containing the workspace, if any.
accessLevel(userId: String)UserAccessLevelThe access level of the given user (defaults to the caller) in this workspace.
members[ProjectMember!]!Workspace members. Only populated when the query passed userIds in the filter.
nameFormulaEnabledBoolean!Whether auto-generated record titles are enabled.
nameFormulaDisplayStringHuman-readable form of the record name formula.
Deprecated field

Workspace.unseenActivity is deprecated. Use unseenActivityCount instead. Workspace.customFields on the workspace is also deprecated — read custom fields via the customFields query.

Full example

This call lists active, non-template workspaces in two organizations whose names contain “marketing”, sorted by manual position then name, and reads the first 50 plus the total count.

query FilteredWorkspaces {
  workspaceList(
    filter: {
      companyIds: ["company_123", "acme-corp"]
      archived: false
      isTemplate: false
      search: "marketing"
      inProject: true
      folderId: null # root-level workspaces only (not in any folder)
    }
    sort: [position_ASC, name_ASC]
    skip: 0
    take: 50
  ) {
    items {
      id
      name
      slug
      position
      archived
      category
      unseenActivityCount
      automationsCount(isActive: true)
      organization {
        id
        name
      }
    }
    totalCount
    pageInfo {
      totalItems
      totalPages
      page
      perPage
      hasNextPage
      hasPreviousPage
    }
  }
}

Behavior notes

  • Folder filtering requires membership. folderId is only valid when listing the user’s own workspaces (inProject omitted or true). Combining folderId (including folderId: null) with inProject: false returns an error, because the user has no folder placement for workspaces they don’t belong to.
  • Position sort needs membership. position_ASC / position_DESC reflect the user’s manual ordering. When inProject: false, position sorting falls back to sorting by name.
  • Non-member defaults. With inProject: false, archived and template workspaces are excluded unless you set archived or isTemplate explicitly.

Errors

CodeWhen
FORBIDDENinProject: false was requested but the user is not an owner of any of the supplied organizations.

Permissions

By default workspaceList returns only workspaces the authenticated user belongs to within the given organizations. Listing workspaces the user is not in (inProject: false) requires the user to be an owner of at least one of the organizations in companyIds.