# Get what a change changed

`GET https://evohub.io/api/v1/catalog/resources/{id}/changes/{change}/diff`

Part of the [Catalog API](https://docs.evohub.io/catalog.md) reference · operationId `getResourceChangeDiff`.

The fields one change touched, each with its value before and after.
List elements are compared by position; values are capped at 2 KB
and the list at 100 fields (`truncated`).

Requires the `catalog:resource:read` scope.

## Authorization

Any one of:

- `bearerKey`
- `headerKey`

Where:

- `bearerKey`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `headerKey`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Path parameters

- `id` (string, required, example `res_6b8d0f2a4c6e8a1c3e5b7d9f1a3c5e7b`): The resource's ID.
- `change` (string, required, example `rch_5c2e8a1f4b7d4e9a8c3f6b0d2e4a7c91`): The change's ID.

## Responses

### 200 — The diff.

Content type: `application/json`

Type: `object`

- `data` (ChangeDiff)
  - `change_id` (string)
  - `fields` (array of object)
    - `path` (string, example `spec.template.spec.containers[0].image`)
    - `from` (any)
    - `to` (any)
  - `truncated` (boolean)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 403 — The key lacks a scope this endpoint needs (`FORBIDDEN`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 404 — Nothing with this ID (or slug) exists in the organization (`NOT_FOUND`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 429 — Too many requests (`RATE_LIMITED`). Wait for `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

## Example request

```bash
curl -X GET 'https://evohub.io/api/v1/catalog/resources/res_6b8d0f2a4c6e8a1c3e5b7d9f1a3c5e7b/changes/rch_5c2e8a1f4b7d4e9a8c3f6b0d2e4a7c91/diff' \
  -H 'Authorization: Bearer <TOKEN>'
```
