---
title: VCL Diff
summary: >-
  Compare the changes in generated VCL between two versions of a service. This
  is sometimes called a "diff" because the comparison may highlight
  "differences" between the versions. To compare the configuration changes
  between two versions of a service represented in YAML format instead, use the
  related <a
  href="https://www.fastly.com/documentation/reference/api/utils/diff/#diff-service-versions">diff</a>
  endpoint.
url: https://www.fastly.com/documentation/reference/api/vcl-services/diff
---

Compare the changes in generated VCL between two versions of a service. This is sometimes called a "diff" because the comparison may highlight "differences" between the versions. To compare the configuration changes between two versions of a service represented in YAML format instead, use the related <a href="https://www.fastly.com/documentation/reference/api/utils/diff/#diff-service-versions">diff</a> endpoint.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `diff` | string | The differences between two specified versions. |
| `format` | string | The format in which compared VCL changes are being returned in. |
| `from` | integer | The version number of the service to which changes in the generated VCL are being compared. |
| `to` | integer | The version number of the service from which changes in the generated VCL are being compared. |

## API endpoints

### Get a comparison of the VCL changes between two service versions

**GET** `/service/{service_id}/vcl/diff/from/{from_version_id}/to/{to_version_id}`

Get a comparison of the VCL changes between two service versions.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `format` | string | query | No | Optional method to format the diff field. |
| `from_version_id` | integer | path | Yes | The version number of the service to which changes in the generated VCL are being compared. Can either be a positive number from 1 to your maximum version or a negative number from -1 down (-1 is latest version etc). |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `to_version_id` | integer | path | Yes | The version number of the service from which changes in the generated VCL are being compared. Uses same numbering scheme as <code>from</code>. |
