---
title: "Diffs · intentic sandbox API"
description: "Both sides of a changed document as text, for the files a line diff cannot show. Every route in the diffs group of the intentic sandbox API."
url: "https://intentic.dev/api/diff/"
---

The workspace

# Diffs

Both sides of a changed document as text, for the files a line diff cannot show

What a diff's two sides are when they are not lines of text. A document, spreadsheet, presentation or notebook that changed is rendered to markdown on both sides — the same reading an agent gets instead of the bytes — so the change shows as tracked changes rather than two downloads. The side on disk reuses the shadow the sandbox already keeps; a past version is rendered from its bytes and kept by content hash, so the same version is never rendered twice. A side nothing can read answers with the reason instead. The bytes themselves are not here: that route streams a body and so sits outside this contract.

**GET`/diff/derived` Both sides of a document's diff, as text**

A document, spreadsheet, presentation or notebook that changed, both versions rendered to markdown the way an agent reads them, so the change can be shown as tracked changes instead of two downloads. The side on disk reuses the shadow the sandbox already keeps; a past version is rendered from its bytes and kept by content hash, so the same version is never rendered twice. A side nothing can read says why.

### What you send

| Field | Type | Where |
| --- | --- | --- |
| `source` required | "working" | "agent" | "commit" | "checkpoint" | query |
| `repo` Which repository: "root" for the workspace… | string | query |
| `side` Which git side the row came… | "staged" | "unstaged" | "conflicted" | query |
| `path` required The file, relative to the repo… | string | query |
| `agent` The conversation whose work is under… | string | query |
| `sha` The commit, compared against its first… | string | query |
| `snapshot` Which saved point | string | query |
| `scope` Which part of the workspace the… | string | query |

### What comes back

| Field | Type |
| --- | --- |
| `before` The file as it was, rendered… | object |
| `when present is true` | shape |
| `content` The side as markdown | string |
| `deriver` Which reader made this text, with… | string |
| `notes` Every cap and degradation the conversion… | string[] |
| `truncated` The rendering was longer than this… | boolean |
| `when present is false` | shape |
| `reason` Why this side has no text:… | string |
| `after` The file as it is now,… | object |
| `when present is true` | shape |
| `content` The side as markdown | string |
| `deriver` Which reader made this text, with… | string |
| `notes` Every cap and degradation the conversion… | string[] |
| `truncated` The rendering was longer than this… | boolean |
| `when present is false` | shape |
| `reason` Why this side has no text:… | string |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/diff/derived?source=working&path=src%2Fapp.ts" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.diff.derived({
 "source": "working",
 "path": "src/app.ts"
});
```

More in The workspace

[Previous ← Git](https://intentic.dev/api/git/)[Next History →](https://intentic.dev/api/history/)
