Copy a Workspace

Duplicate a workspace within an organization or across organizations, choosing exactly which elements to include.


Use the copyWorkspace mutation to duplicate an existing workspace, either within the same organization or into a different one. It is the way to build reusable workspace templates, stand up similar projects quickly, or move work between organizations. Workspaces are Workspace objects in the API.

Copying runs asynchronously: the mutation queues a background job and returns immediately. Track progress with the copyProjectStatus query.

Request

The smallest call needs the source workspace projectId, a name for the copy, and an options object selecting what to include.

mutation CopyWorkspace {
  copyWorkspace(
    input: {
      projectId: "project_123"
      name: "New workspace copy"
      options: { todos: true, todoLists: true, people: true }
    }
  )
}

The projectId and companyId arguments accept either an ID or a slug.

Parameters

CopyWorkspaceInput

ParameterTypeRequiredDescription
projectIdString!YesID or slug of the workspace to copy.
nameString!YesName for the new workspace (max 50 characters). Trimmed, and any URLs are stripped out.
descriptionStringNoDescription for the new workspace (max 500 characters).
imageURLStringNoCover image URL for the new workspace.
companyIdStringNoID or slug of the organization to create the copy in. Defaults to the source workspace’s organization.
optionsCopyProjectOptionsInput!YesWhich elements to copy. See below.

CopyProjectOptionsInput

Every option is an optional Boolean; omit one or set it to false to skip that element. Some options only take effect when a related option is also enabled — see Notes.

ParameterTypeDescription
todosBooleanCopy records (the Record objects in each list).
todoListsBooleanCopy lists (the RecordList columns/sections).
todoActionsBooleanCopy record actions.
todoCommentsBooleanCopy comments on records.
checklistsBooleanCopy record checklists.
dueDatesBooleanCopy record due dates.
coverConfigBooleanCopy record cover-image configuration.
assigneesBooleanCopy record assignees. Requires people: true.
peopleBooleanCopy workspace members.
workspaceUserRolesBooleanCopy member roles and permissions. Requires people: true.
tagsBooleanCopy workspace tags.
customFieldsBooleanCopy custom field definitions and their values.
filesBooleanCopy file attachments.
formsBooleanCopy workspace forms.
automationsBooleanCopy workspace automations.
discussionsBooleanCopy workspace discussions.
discussionCommentsBooleanCopy comments on discussions. Requires discussions: true.
statusUpdatesBooleanCopy workspace status updates.
statusUpdateCommentsBooleanCopy comments on status updates. Requires statusUpdates: true.

Response

copyWorkspace returns a nullable Boolean. It returns true once the copy job has been queued.

{
  "data": {
    "copyWorkspace": true
  }
}

Full example

Copy a workspace into a different organization with a richer set of options.

mutation CopyWorkspace {
  copyWorkspace(
    input: {
      projectId: "project_123"
      name: "Q2 Marketing Campaign"
      description: "Copy of Q1 campaign with an updated timeline"
      imageURL: "https://example.com/campaign-cover.png"
      companyId: "company_123"
      options: {
        todos: true
        todoLists: true
        todoActions: true
        checklists: true
        dueDates: true
        coverConfig: true
        people: true
        assignees: true
        workspaceUserRoles: true
        tags: true
        customFields: true
        files: true
        forms: true
        automations: true
        discussions: false
        discussionComments: false
        statusUpdates: false
        statusUpdateComments: false
      }
    }
  )
}

Checking copy status

Because the copy runs in the background, poll the copyProjectStatus query to follow progress. It returns the status of the calling user’s current copy job, or null when none is in progress.

query CheckCopyStatus {
  copyProjectStatus {
    queuePosition
    totalQueues
    isActive
    isTemplate
    newProjectName
    oldProject {
      id
      name
    }
    oldCompany {
      id
      name
    }
    newCompany {
      id
      name
    }
  }
}

CopyProjectStatus fields

FieldTypeDescription
queuePositionIntPosition of this copy job in the queue.
totalQueuesIntTotal number of copy jobs currently queued.
isActiveBooleanWhether the copy is actively running (vs. still waiting in the queue).
oldProjectWorkspaceThe source workspace being copied.
newProjectNameStringName of the new workspace being created.
isTemplateBooleanWhether the copy is being created as a template.
oldCompanyOrganizationSource organization.
newCompanyOrganizationTarget organization.
{
  "data": {
    "copyProjectStatus": {
      "queuePosition": 1,
      "totalQueues": 3,
      "isActive": true,
      "isTemplate": false,
      "newProjectName": "Q2 Marketing Campaign",
      "oldProject": { "id": "clm4n8qwx000008l0g4oxdqn7", "name": "Q1 Marketing Campaign" },
      "oldCompany": { "id": "clm4n8qwx000108l0a1b2c3d4", "name": "Acme Inc" },
      "newCompany": { "id": "clm4n8qwx000208l0e5f6g7h8", "name": "Acme EU" }
    }
  }
}

Errors

CodeWhen
FORBIDDENYou lack OWNER or ADMIN access to the source workspace, or it is archived.
PROJECT_NOT_FOUNDThe source workspace doesn’t exist or you can’t access it. Message: Project was not found.
COMPANY_NOT_FOUNDThe target organization (companyId) doesn’t exist or you aren’t a member of it. Message: Company was not found.
CREATE_PROJECT_LIMITThe source workspace has more than 250,000 records. Message: Project size exceeds maximum limit.

A copy that is rejected because you already have one in progress returns a generic error with the message Oops! and no extension code.

{
  "errors": [
    {
      "message": "Project size exceeds maximum limit.",
      "extensions": {
        "code": "CREATE_PROJECT_LIMIT"
      }
    }
  ]
}

Permissions

You must hold an OWNER or ADMIN role in the source workspace, and the source workspace must be active (not archived).

ScenarioRequired access
Copy within the same organizationOWNER or ADMIN in the source workspace.
Copy into a different organizationOWNER or ADMIN in the source workspace, and membership of the target organization.

Notes

  • One copy at a time. Each user can have a single copy job in progress. Starting another while one is running fails with Oops!.
  • Size limit. Workspaces with more than 250,000 records cannot be copied.
  • Dependent options. A few options only apply when their parent is also enabled: assignees and workspaceUserRoles require people: true; discussionComments requires discussions: true; statusUpdateComments requires statusUpdates: true.
  • Name handling. The new workspace name is trimmed and has any URLs removed before the copy runs.
  • Status retention. A copy job’s status stays available via copyProjectStatus for up to 6 hours.