Workspaces: sync

Requires authorization

Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities. Try it now.

Request

HTTP request

POST https://www.googleapis.com/tagmanager/v2/+path:sync

Parameters

Parameter name Value Description
Path parameters
path string GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/tagmanager.edit.containers

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "syncStatus": {
    "mergeConflict": boolean,
    "syncError": boolean
  },
  "mergeConflict": [
    {
      "entityInWorkspace": {
        "tag": accounts.containers.workspaces.tags Resource,
        "trigger": accounts.containers.workspaces.triggers Resource,
        "variable": accounts.containers.workspaces.variables Resource,
        "folder": accounts.containers.workspaces.folders Resource,
        "changeStatus": string
      },
      "entityInBaseVersion": {
        "tag": accounts.containers.workspaces.tags Resource,
        "trigger": accounts.containers.workspaces.triggers Resource,
        "variable": accounts.containers.workspaces.variables Resource,
        "folder": accounts.containers.workspaces.folders Resource,
        "changeStatus": string
      }
    }
  ]
}
Property name Value Description Notes
syncStatus nested object Indicates whether synchronization caused a merge conflict or sync error.
syncStatus.mergeConflict boolean Synchornization operation detected a merge conflict.
syncStatus.syncError boolean An error occurred during the synchronization operation.
mergeConflict[] list The merge conflict after sync. If this field is not empty, the sync is still treated as successful. But a version cannot be created until all conflicts are resolved.
mergeConflict[].entityInWorkspace nested object The workspace entity that has conflicting changes compared to the base version. If an entity is deleted in a workspace, it will still appear with a deleted change status.
mergeConflict[].entityInWorkspace.tag nested object The tag being represented by the entity.
mergeConflict[].entityInWorkspace.trigger nested object The trigger being represented by the entity.
mergeConflict[].entityInWorkspace.variable nested object The variable being represented by the entity.
mergeConflict[].entityInWorkspace.folder nested object The Folder being represented by the entity.
mergeConflict[].entityInWorkspace.changeStatus string Represents how the entity has been changed in the workspace.

Acceptable values are:
  • "added"
  • "changeStatusUnspecified"
  • "deleted"
  • "none"
  • "updated"
mergeConflict[].entityInBaseVersion nested object The base version entity (since the latest sync operation) that has conflicting changes compared to the workspace. If this field is missing, it means the workspace entity is deleted from the base version.
mergeConflict[].entityInBaseVersion.tag nested object The tag being represented by the entity.
mergeConflict[].entityInBaseVersion.trigger nested object The trigger being represented by the entity.
mergeConflict[].entityInBaseVersion.variable nested object The variable being represented by the entity.
mergeConflict[].entityInBaseVersion.folder nested object The Folder being represented by the entity.
mergeConflict[].entityInBaseVersion.changeStatus string Represents how the entity has been changed in the workspace.

Acceptable values are:
  • "added"
  • "changeStatusUnspecified"
  • "deleted"
  • "none"
  • "updated"

Try it!

Use the APIs Explorer below to call this method on live data and see the response.