Read What a Sandbox Deploy Changed

Read the comparison recorded when a pipe sandbox version was published to production.

⚠️

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 production pipe. A token that does not returns PERMISSION_DENIED.
  3. Pipe ID: The ID of the production pipe. See Get resource IDs.
  4. A published sandbox: The pipe needs a version deployed with Deploy a Pipe Sandbox Version. Each deploy publishes a snapshot, and that snapshot leads to the version.

Step 1: Read the Recorded Changes

When a sandbox is published, the deploy records what it sent to production: the comparison between the production snapshot the deploy started from and the sandbox snapshot that was reviewed. deployChanges returns that record. Reach it from the snapshot the deploy published, through repoVersion. List the versions with snapshots first, then read the changes of the one being opened.

query {
  pipe(id: 123) {
    snapshot(versionId: "3f9a1c2b7d8e4f60a1b2c3d4e5f60718") {
      sequenceIndex
      versionId
      repoVersion {
        id
        deployChanges
      }
    }
  }
}

Input Explanation:

  • pipe.id (required): The production pipe.
  • snapshot.versionId (required here): The version to read, taken from the snapshots list. Only a snapshot published by a sandbox deploy has a repoVersion. See Read a Pipe's Snapshots and Operations.

Sample Response (one phase renamed in the sandbox; the categories with no changes are trimmed):

{
  "data": {
    "pipe": {
      "snapshot": {
        "sequenceIndex": 4,
        "versionId": "3f9a1c2b7d8e4f60a1b2c3d4e5f60718",
        "repoVersion": {
          "id": "55",
          "deployChanges": {
            "summary": { "created": 0, "updated": 1, "deleted": 0, "total": 1 },
            "categories": [
              { "key": "pipe_configuration", "changes": 0, "sections": [] },
              {
                "key": "phases_and_fields",
                "changes": 1,
                "rows": [
                  {
                    "entity": "phases",
                    "id": "344166802",
                    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "title": "Second look",
                    "color": "blue",
                    "status": "updated",
                    "properties": [
                      { "key": "phases.name", "status": "updated", "from": "Review", "to": "Second look" }
                    ]
                  }
                ]
              }
            ],
            "references": {
              "production": { "repos": { "123": { "name": "Onboarding" } } },
              "sandbox": { "repos": { "123": { "name": "Onboarding" } } }
            }
          }
        }
      }
    }
  }
}

Response Fields

  • deployChanges: one JSON object with summary, categories and references, in the same shape as Compare a Pipe Sandbox to Production with the TOUCHED filter. It holds only the changed rows and the unchanged rows needed to place them.
  • Ids: rows and references carry production ids, including the rows the deploy created, which carry the id they received in production.

Key Notes

  • Recorded once, at publish time: the comparison is taken from the two snapshots the deploy used, so later edits to production do not change it.
  • One version per request: deployChanges reads the record from storage, so a request reads it for one version only. Asking for it on a second version in the same request returns an error on that field. Use snapshots to list the versions without deployChanges.
  • Null, not an error: deployChanges is null for a version that was not published and for a version published before deploys were recorded. Treat null as "not recorded".
  • Production pipe is authorized: the token must administer the production pipe. A token that does not receives PERMISSION_DENIED.
  • No storage URL: the record is returned inline. There is no signed URL for it.
  • Automation credentials are left out: authentication headers and keys of HTTP request automations are not part of versions, so they never appear in the record.
  • Paid plans only: on the free plan, snapshots returns FEATURE_NOT_ALLOWED_BY_ORGANIZATION_PLAN, so the record cannot be reached.