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:
Scope |
---|
https://www.googleapis.com/auth/tagmanager.edit.containers |
For more information, see the authentication and authorization page.
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, "client": accounts.containers.workspaces.clients Resource, "transformation": accounts.containers.workspaces.transformations Resource, "zone": accounts.containers.workspaces.zones Resource, "customTemplate": accounts.containers.workspaces.templates Resource, "builtInVariable": { "path": string, "accountId": string, "containerId": string, "workspaceId": string, "type": string, "name": string }, "gtagConfig": accounts.containers.workspaces.gtag_config 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, "client": accounts.containers.workspaces.clients Resource, "transformation": accounts.containers.workspaces.transformations Resource, "zone": accounts.containers.workspaces.zones Resource, "customTemplate": accounts.containers.workspaces.templates Resource, "builtInVariable": { "path": string, "accountId": string, "containerId": string, "workspaceId": string, "type": string, "name": string }, "gtagConfig": accounts.containers.workspaces.gtag_config 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:
|
|
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:
|
|
mergeConflict[].entityInWorkspace.client |
nested object |
The client being represented by the entity. | |
mergeConflict[].entityInBaseVersion.client |
nested object |
The client being represented by the entity. | |
mergeConflict[].entityInWorkspace.transformation |
nested object |
The transformation being represented by the entity. | |
mergeConflict[].entityInBaseVersion.transformation |
nested object |
The transformation being represented by the entity. | |
mergeConflict[].entityInWorkspace.zone |
nested object |
The zone being represented by the entity. | |
mergeConflict[].entityInWorkspace.customTemplate |
nested object |
The custom template being represented by the entity. | |
mergeConflict[].entityInWorkspace.builtInVariable |
nested object |
The built in variable being represented by the entity. | |
mergeConflict[].entityInWorkspace.builtInVariable.path |
string |
GTM BuiltInVariable's API relative path. | |
mergeConflict[].entityInWorkspace.builtInVariable.accountId |
string |
GTM Account ID. | |
mergeConflict[].entityInWorkspace.builtInVariable.containerId |
string |
GTM Container ID. | |
mergeConflict[].entityInWorkspace.builtInVariable.workspaceId |
string |
GTM Workspace ID. | |
mergeConflict[].entityInWorkspace.builtInVariable.type |
string |
Type of built-in variable.
Acceptable values are:
|
|
mergeConflict[].entityInWorkspace.builtInVariable.name |
string |
Name of the built-in variable to be used to refer to the built-in variable. | |
mergeConflict[].entityInWorkspace.gtagConfig |
nested object |
The gtag config being represented by the entity. | |
mergeConflict[].entityInBaseVersion.zone |
nested object |
The zone being represented by the entity. | |
mergeConflict[].entityInBaseVersion.customTemplate |
nested object |
The custom template being represented by the entity. | |
mergeConflict[].entityInBaseVersion.builtInVariable |
nested object |
The built in variable being represented by the entity. | |
mergeConflict[].entityInBaseVersion.builtInVariable.path |
string |
GTM BuiltInVariable's API relative path. | |
mergeConflict[].entityInBaseVersion.builtInVariable.accountId |
string |
GTM Account ID. | |
mergeConflict[].entityInBaseVersion.builtInVariable.containerId |
string |
GTM Container ID. | |
mergeConflict[].entityInBaseVersion.builtInVariable.workspaceId |
string |
GTM Workspace ID. | |
mergeConflict[].entityInBaseVersion.builtInVariable.type |
string |
Type of built-in variable.
Acceptable values are:
|
|
mergeConflict[].entityInBaseVersion.builtInVariable.name |
string |
Name of the built-in variable to be used to refer to the built-in variable. | |
mergeConflict[].entityInBaseVersion.gtagConfig |
nested object |
The gtag config being represented by the entity. |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.