Inspect

Get session diff

Retrieve the raw unified diff for an authorized Inspect session. The endpoint is session-scoped and does not accept arbitrary diff file IDs. Pending or running sessions return the local working-tree diff when one is available; otherwise the stored authoritative session diff is returned.

Base URL
GET
/api/v2/sessions/{session_id}/diff

Retrieve the raw unified diff for an authorized Inspect session. The endpoint is session-scoped and does not accept arbitrary diff file IDs. Pending or running sessions return the local working-tree diff when one is available; otherwise the stored authoritative session diff is returned.

Authorization

bearerAuth sessions:read
headerAuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

Scope: sessions:read

Path Parameters

session_id*string

The unique identifier of the session

Query Parameters

repository?string

Repository ID whose diff should be returned. Must be one of the session's repositories. Defaults to the first one.

Response Body

Raw unified diff for the session

response?stringtext/plain
Example Request
curl -X GET 'https://app.inspect.com/api/v2/sessions/h2k9x4m7q1pd/diff'
Example Response
"string"