Restore a pipe's versioned structure back to one of its uploaded snapshots using the restoreRepoToSnapshot mutation.
BETA - This API is currently in beta testing. If you encounter issues or have feedback, contact our support team.
Before You Begin
🔗 Use the GraphQL Playground to execute the queries in this guide.
➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.
Prerequisites
- Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
- Permissions: Your token must have
Admin(manage) permission on the target pipe. - Pipe ID: The ID of the pipe you want to restore. See Get resource IDs.
- Snapshot version: The
versionIdof an uploaded snapshot of the pipe. List them with Read a Pipe's Snapshots and Operations, or create one with Create a Pipe Snapshot and use itsversionIdonce it reachesUPLOADED.
Step 1: Restore the Pipe
Use the restoreRepoToSnapshot mutation to reconcile a pipe's versioned structure (phases, fields, automations, conditions, and related entities) back to a snapshot. The restore runs in the background: the mutation validates the request, acknowledges it, and returns the snapshot the pipe is being restored to.
mutation {
restoreRepoToSnapshot(input: {
repoId: 123
versionId: "9f1c2d34-5678-49ab-bcde-0123456789ab"
}) {
repoSnapshot {
id
versionId
sequenceIndex
status
}
}
}
Input Explanation:
repoId(required): The ID of the pipe to restore.versionId(required): TheversionId(UUID) of the uploaded snapshot of the pipe to restore to.
Sample Response:
The mutation returns the target snapshot as confirmation of the version the pipe is being restored to. The restore itself is applied in the background.
{
"data": {
"restoreRepoToSnapshot": {
"repoSnapshot": {
"id": "456",
"versionId": "9f1c2d34-5678-49ab-bcde-0123456789ab",
"sequenceIndex": 3,
"status": "UPLOADED"
}
}
}
}
Key Notes
- Any uploaded version: You can restore to any
UPLOADEDsnapshot of the pipe, not only the latest. AversionIdthat is unknown, belongs to another pipe, or is stillPENDINGorFAILEDreturns aSNAPSHOT_NOT_RESTORABLEerror and applies nothing. While restoring older versions is still being rolled out to your organization, only the latest uploaded snapshot is accepted, and any other returns the same error. - Every restore adds a version: When the restore finishes, the restored structure is saved as a new version at the top of the history, and its
restoredFromSnapshotnames the version you restored. Existing versions are never changed. - Older versions restore what they recorded: A version taken before some configuration became part of versioning does not include it, and that part of the pipe is kept as it is.
- Asynchronous restore: The mutation does not apply the changes inline. It validates the request and enqueues the restore, which computes the difference between the live pipe and the snapshot and reconciles the pipe to match. The mutation returns the target snapshot rather than an operation handle, but the restore is recorded as a
RESTOREchange-management operation: read its status through the pipe'soperationsfield or the snapshot's ownoperationsconnection. See Read a Pipe's Snapshots and Operations. - One change at a time: While a restore of the pipe, to any version, or a Sandbox deploy is pending or running, a new request returns a
RESTORE_ALREADY_IN_PROGRESSerror and enqueues nothing. Wait for it to finish rather than retrying immediately. - No restore with an open Sandbox: While the pipe has an open Sandbox, or one is being created, the request returns a
REPO_VERSION_OPENerror. Publish or discard the Sandbox first. - Full structural restore, no preview: The restore reconciles the pipe's versioned structure to the snapshot. This delivery has no
forceargument and no impact preview: the restore is applied directly, without a dry run of the changes it will make. - Admin only: Only pipe admins can restore a pipe. Tokens without
Admin(manage) permission on the pipe receive aPERMISSION_DENIEDerror. - Pipe not found: An invalid or non-existent
repoIdreturns aRECORD_NOT_FOUNDerror. - Gradual rollout: This operation is being rolled out behind a feature flag and may not yet be available for every organization.
- Related operations: Create a Pipe Snapshot, Read a Pipe's Snapshots and Operations and Open a Pipe Sandbox Version.

