---
search:
  tags:
    - Secrets
    - GET
seo:
  description: >-
    Compares the secret keys of two environments and reports what is added,
    removed or changed.… Reference for the GET /secrets/diff endpoint in the
    varsafe API.
sidebar:
  label: Diff two environments
  badge: GET
title: Diff two environments
type: openapi-operation
---
Compares the secret keys of two environments and reports what is added, removed or changed. Useful before promoting configuration between environments.

`GET /secrets/diff`

**Responses**

- `200` — Success.
- `400` — The request failed validation. \`field\` names the offending input.
- `401` — No credential was presented, or it is invalid or revoked.
- `403` — The credential is valid but lacks the required scope, role or team access.
- `404` — The resource does not exist, or is not visible to this credential.
- `429` — Rate limited. Retry after the interval named in the response.
- `500` — Unexpected server error. The body never carries internal detail.

Response example, 200:

```json
{
  "project": "string",
  "source": "string",
  "target": "string",
  "onlyInSource": [
    "string"
  ],
  "onlyInTarget": [
    "string"
  ],
  "different": [
    "string"
  ],
  "identical": [
    "string"
  ]
}
```
