Preview a Pipe Restore

See what restoring a saved version would change in the pipe as it is now, before you restore it.

⚠️

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

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: Your token must have Admin (manage) permission on the pipe. A token that does not returns PERMISSION_DENIED.
  3. An uploaded version: The version must be UPLOADED. List the pipe's versions with Read a Pipe's Snapshots and Operations to find its versionId.

Read the Preview

restorePreview compares the version with the pipe as it is now and returns, as one JSON value, what Restore a pipe to a snapshot would change. Nothing is restored and nothing is saved.

query {
  pipe(id: 123) {
    snapshot(versionId: "8f6c1d52-7c1e-4f4b-9a57-0b5d3f1e2a90") {
      restorePreview(filter: TOUCHED)
    }
  }
}

Input Explanation:

  • pipe.id (required): The pipe the version belongs to.
  • versionId (required here): The version to preview. Without it, snapshot returns the latest uploaded version.
  • filter (optional): ALL returns every row and property, including unchanged ones. TOUCHED returns only the changed rows, plus the unchanged rows needed to place them. Omitting the argument and passing an explicit null both behave as ALL.

Sample Response (TOUCHED: a phase was renamed from "Review" to "Second look" after the version, so restoring renames it back):

{
  "data": {
    "pipe": {
      "snapshot": {
        "restorePreview": {
          "summary": { "created": 0, "updated": 1, "deleted": 0, "total": 1 },
          "categories": [
            {
              "key": "phases_and_fields",
              "changes": 1,
              "rows": [
                {
                  "entity": "phases",
                  "id": "344166802",
                  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                  "title": "Review",
                  "status": "updated",
                  "properties": [
                    { "key": "phases.name", "status": "updated", "from": "Second look", "to": "Review" }
                  ]
                }
              ]
            }
          ],
          "references": {
            "production": { "repos": { "123": { "name": "Purchase requests" } } },
            "sandbox": { "repos": { "123": { "name": "Purchase requests" } } }
          }
        }
      }
    }
  }
}

Response Fields

The response has the same shape as Compare a Pipe Sandbox to Production: summary, categories and references, with the same rows, properties and collection items. Only the sides change:

  • from and production: the pipe as it is now.
  • to and sandbox: the pipe after the restore, as the version recorded it.
  • created: a row the restore brings back. deleted: a row the restore removes, because it was added after the version.

Key Notes

  • What the restore writes: the preview follows the restore, not a Sandbox publish. So it also compares the pipe name, its public identifiers (repos.slug, repos.email_inbox_name) and the start form's public slug, which a restore writes back. HTTP request automations are compared as they are: a restore does not switch them off as publishing does.
  • What the restore skips: phase assignments of users who are no longer pipe members, assignments to phases of other pipes, and phase jumps into phases the version does not have are left out, as the restore leaves them out. AI agents and webhooks are never part of versions.
  • Credentials are never returned: webhook headers and automation credentials are removed from both sides.
  • One version per request: a request can preview one version. Once a preview succeeds, every further restorePreview in the same request, through snapshots or through another snapshot(versionId:), returns PIPEFY_RUNTIME. A preview that fails, such as one of a PENDING version, does not count.
  • Version not ready: a PENDING or FAILED version, or one whose stored file cannot be read, returns PIPEFY_RUNTIME. Handle errors by code, not by message: the message is translated to the caller's locale.
  • Admin only: only pipe admins can preview a restore. A token without Admin (manage) permission on the pipe receives PERMISSION_DENIED.
  • Paid plans only: like the restore, the preview is not available on the free plan. For a pipe whose organization is on the free plan, snapshot returns FEATURE_NOT_ALLOWED_BY_ORGANIZATION_PLAN.
  • A snapshot of now: the preview reads the pipe when the request runs. A change made after it is not in the preview, and the restore applies the version to the pipe as it is when the restore runs.
  • Related operations: Restore a pipe to a snapshot and Read a Pipe's Snapshots and Operations.