---
title: "Diff Prompt Versions"
method: GET
path: "/v1/prompts/{id}/versions/diff"
tags: ["Prompt Versions"]
---

# Diff Prompt Versions

`GET /v1/prompts/{id}/versions/diff`

Compares the templates of two prompt versions side-by-side and returns a unified diff. Requires read access to the prompt.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `from` string, required
- `to` string, required

## Response `200`

Versions compared successfully

- object
  - `from_version` integer, required
  - `to_version` integer, required
  - `from_template` string, required
  - `to_template` string, required
  - `diff` string, required

## Other responses

- `400` — Missing or invalid parameters
- `401` — Unauthorized
- `404` — Prompt or version not found

## Changes

- **2026-07-14** `bed7a47c6f25` — 2 info
  - for the `query` request parameter `from`, the type/format was generalized from `integer`/`` to `string`/``
  - for the `query` request parameter `to`, the type/format was generalized from `integer`/`` to `string`/``
- **2026-07-02** `e500bc0895c5` — 1 info
  - the endpoint scheme security `ApiKeyAuth` was removed from the API
- **2026-06-29** `162c1e986d3a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/px0-ai/apis/px0-api/changes/v1/prompts/:id/versions/diff/get.md)

---

[API](https://skmtc.dev/px0-ai/apis/px0-api.md) · [All operations](https://skmtc.dev/px0-ai/apis/px0-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/px0-ai/px0-api/revisions/3ed72443989d/schema)
