# Get expected-vs-actual diff for a failing regression test result **GET /runs/{run_id}/samples/{sample_id}/diff** The legacy diff route is header-gated (X-Requested-With: XMLHttpRequest), not role-gated. The 403 seen on direct browser requests was a header-check artifact. This endpoint wraps the XHR logic and returns structured JSON — no HTML, no 50-line truncation. ## Servers - Production: https://sampleplatform.ccextractor.org/api/v1 (Production) ## Authentication methods - Bearer auth ## Parameters ### Path parameters - **run_id** (integer) Numeric run ID - **sample_id** (integer) Numeric sample or regression result ID ### Query parameters - **regression_id** (integer) Regression test definition ID - **output_id** (integer) Output file ID within a regression test definition - **context_lines** (integer) - **format** (string) ## Responses ### 200 Structured or unified diff #### Body: application/json (object) - **run_id** (integer) - **sample_id** (integer) - **regression_id** (integer) - **output_id** (integer) - **status** (string) - **summary** (object) - **hunks** (array[object]) ### 401 Missing, expired, or invalid bearer token #### Body: application/json (object) - **code** (string) Machine-readable error code (snake_case) - **message** (string) Human-readable error summary - **details** (object) Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available. ### 404 Resource not found #### Body: application/json (object) - **code** (string) Machine-readable error code (snake_case) - **message** (string) Human-readable error summary - **details** (object) Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available. ### 429 Too many requests. Retry after the indicated number of seconds. #### Headers - **Retry-After** (integer) Seconds to wait before retrying - **X-RateLimit-Limit** () Maximum requests allowed in the current window - **X-RateLimit-Remaining** () Requests remaining in the current window - **X-RateLimit-Reset** () Unix timestamp when the rate limit window resets #### Body: application/json (object) - **code** (string) Machine-readable error code (snake_case) - **message** (string) Human-readable error summary - **details** (object) Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available. ### default Unexpected server error #### Body: application/json (object) - **code** (string) Machine-readable error code (snake_case) - **message** (string) Human-readable error summary - **details** (object) Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available. [Powered by Bump.sh](https://bump.sh)