---
# @generated by sylphx-gen. Do not edit.
title: "Download workspace diff on an agent session"
description: "`agents.agent_sessions.download_workspace_diff` (GET /v1/{name}:downloadWorkspaceDiff): Downloads the exact patch referenced by the committed handback."
type: reference
product: agents
summary: "Downloads the exact patch referenced by the committed handback."
nav: false
---

Downloads the exact patch referenced by the committed handback.

- **Path** `GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session:downloadWorkspaceDiff`
- **Scope** `agents:sessions`
- **Effect** `read` — nothing is written.
- **Collection** [agent_sessions](/docs/api/agent_sessions)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | Canonical source Session resource name. Required. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `patch` | `bytes` | Exact UTF-8 Git patch bytes, base64 on HTTP, at most 64 KiB. Never returned again. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session:downloadWorkspaceDiff" \
  -H "Authorization: Bearer $SYLPHX_API_KEY"
```

**TypeScript**

```ts
const response = await sylphx.agents.agentSessions.downloadWorkspaceDiff({ name: 'orgs/acme/projects/shop/envs/production/agent_sessions/agent-session' })
```

**Rust**

```rust
let mut req = sylphx::agents::DownloadAgentSessionWorkspaceDiffRequest::default();
req.name = "orgs/acme/projects/shop/envs/production/agent_sessions/agent-session".to_string();
let response = sx.agents().agent_sessions().download_workspace_diff(req).await?;
```

**CLI**

```bash
sylphx agents agent-sessions download-workspace-diff orgs/acme/projects/shop/envs/production/agent_sessions/agent-session
```

**MCP**

```json
{ "method_id": "agents.agent_sessions.download_workspace_diff", "args": {"name":"orgs/acme/projects/shop/envs/production/agent_sessions/agent-session"} }
```
