Skip to content
SegmentStream/ Docs

Loading documentation…

↑ ↓ to navigate  ↵ to open  Esc to close
Website Console
Section menu

Compare repository revisions

GET /api/workspaces/{workspaceId}/repository/compare/{range}

Endpoint

GET/api/workspaces/{workspaceId}/repository/compare/{range}

Inspect commits and file changes between the base and head of a revision range. This is a repeatable read. See repositories_commitChanges. Required personal key scopes: workspace:view, repository:read.

Authorization

Bearer token · workspace:view · repository:read

Parameters

workspaceId path · string · required
Workspace UUID returned by list workspaces.
range path · string · required
Git comparison range naming the base and head revisions.
API-Version header · string · optional
Optional platform API major version. Omit to use the current default. Allowed values: 1

Responses

200 Success
application/json schema
{
  "type": "object",
  "properties": {
    "base": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^[a-f0-9]{40}$",
          "description": "Digest identifying this version of the object."
        },
        "treeHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{40}$",
          "description": "Git object ID of the commit’s root tree."
        },
        "message": {
          "type": "string",
          "description": "Human-readable message emitted by the operation."
        },
        "author": {
          "$ref": "#/components/schemas/SharedObject_151"
        },
        "committer": {
          "$ref": "#/components/schemas/SharedObject_152"
        },
        "parents": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "description": "Hashes of the commit’s parents."
        },
        "authoredAt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Time when the item was authored."
            }
          ]
        },
        "committedAt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Time when the item was committed."
            }
          ]
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "files": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ],
                  "allOf": [
                    {
                      "description": "Files included in this revision or result."
                    }
                  ]
                },
                "additions": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ],
                  "allOf": [
                    {
                      "description": "Number of added lines in the diff."
                    }
                  ]
                },
                "deletions": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ],
                  "allOf": [
                    {
                      "description": "Number of removed lines in the diff."
                    }
                  ]
                }
              },
              "required": [
                "files",
                "additions",
                "deletions"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "description": "Summary statistics for the selected revision or operation."
        }
      },
      "required": [
        "hash",
        "treeHash",
        "message",
        "author",
        "committer",
        "parents",
        "authoredAt",
        "committedAt"
      ],
      "additionalProperties": false,
      "description": "Starting revision of the comparison."
    },
    "head": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^[a-f0-9]{40}$",
          "description": "Digest identifying this version of the object."
        },
        "treeHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{40}$",
          "description": "Git object ID of the commit’s root tree."
        },
        "message": {
          "type": "string",
          "description": "Human-readable message emitted by the operation."
        },
        "author": {
          "$ref": "#/components/schemas/SharedObject_151"
        },
        "committer": {
          "$ref": "#/components/schemas/SharedObject_152"
        },
        "parents": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "description": "Hashes of the commit’s parents."
        },
        "authoredAt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Time when the item was authored."
            }
          ]
        },
        "committedAt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Time when the item was committed."
            }
          ]
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "files": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ],
                  "allOf": [
                    {
                      "description": "Files included in this revision or result."
                    }
                  ]
                },
                "additions": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ],
                  "allOf": [
                    {
                      "description": "Number of added lines in the diff."
                    }
                  ]
                },
                "deletions": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ],
                  "allOf": [
                    {
                      "description": "Number of removed lines in the diff."
                    }
                  ]
                }
              },
              "required": [
                "files",
                "additions",
                "deletions"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "description": "Summary statistics for the selected revision or operation."
        }
      },
      "required": [
        "hash",
        "treeHash",
        "message",
        "author",
        "committer",
        "parents",
        "authoredAt",
        "committedAt"
      ],
      "additionalProperties": false,
      "description": "Ending revision of the comparison."
    },
    "aheadBy": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "enum": [
            "Infinity",
            "-Infinity",
            "NaN"
          ]
        }
      ],
      "allOf": [
        {
          "description": "Number of commits reachable from the head beyond the base."
        }
      ]
    },
    "commits": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SharedObject_150"
      },
      "description": "Git commits included in this page or comparison."
    },
    "commitsTruncated": {
      "type": "boolean",
      "description": "Whether the response omitted commits due to a size limit."
    },
    "changes": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SharedObject_153"
      },
      "description": "Paths added, modified, renamed or removed between the revisions."
    },
    "stats": {
      "type": "object",
      "properties": {
        "files": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Files included in this revision or result."
            }
          ]
        },
        "additions": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Number of added lines in the diff."
            }
          ]
        },
        "deletions": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "enum": [
                "Infinity",
                "-Infinity",
                "NaN"
              ]
            }
          ],
          "allOf": [
            {
              "description": "Number of removed lines in the diff."
            }
          ]
        }
      },
      "required": [
        "files",
        "additions",
        "deletions"
      ],
      "additionalProperties": false,
      "description": "Summary statistics for the selected revision or operation."
    },
    "truncated": {
      "type": "boolean",
      "description": "Whether the server omitted results because a limit was reached."
    }
  },
  "required": [
    "base",
    "head",
    "aheadBy",
    "commits",
    "commitsTruncated",
    "changes",
    "stats",
    "truncated"
  ],
  "additionalProperties": false
}
Full schema and referenced types ↗
Example
{
  "base": {
    "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "treeHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "message": "Build complete",
    "author": {
      "name": "analytics",
      "email": "alex@example.com"
    },
    "committer": {
      "name": "analytics",
      "email": "alex@example.com"
    },
    "parents": [],
    "authoredAt": 0,
    "committedAt": 0
  },
  "head": {
    "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "treeHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "message": "Build complete",
    "author": {
      "name": "analytics",
      "email": "alex@example.com"
    },
    "committer": {
      "name": "analytics",
      "email": "alex@example.com"
    },
    "parents": [],
    "authoredAt": 0,
    "committedAt": 0
  },
  "aheadBy": 0,
  "commits": [],
  "commitsTruncated": false,
  "changes": [],
  "stats": {
    "files": 0,
    "additions": 0,
    "deletions": 0
  },
  "truncated": false
}
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
Deprecation
Present when the operation is deprecated. RFC 9745 date in seconds since the Unix epoch.
Sunset
Present when retirement is scheduled. HTTP date of planned removal, per RFC 8594.
400 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
401 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
403 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
404 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
406 Unsupported platform API version
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
409 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
429 Request limit reached
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
Retry-After
Seconds to wait before retrying the request.
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
500 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
503 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).