diff-scans

Create diff scan from full scan IDs

Changed on

Create a diff scan from two existing full scan IDs. The full scans must be in the same repository. Returns metadata about the diff scan. Once the diff scan is created, fetch the diff scan from the api_url URL to get the contents of the diff.

This endpoint consumes 1 unit of your quota.

This endpoint requires the following org token scopes: - diff-scans:create

  • full-scans:list
post/orgs/{org_slug}/diff-scans/from-ids

Request

  • Base URL
    https://api.socket.dev/v0
  • URL
    https://api.socket.dev/v0/orgs/{org_slug}/diff-scans/from-ids
  • Auth
    • HTTP bearer
    • or HTTP basic

Path parameters

org_slugstring required

The slug of the organization

Query parameters

beforestring required

The ID of the before/base full scan (older)

afterstring required

The ID of the after/head full scan (newer)

descriptionstring

A description of the diff scan. This will be used in the diff report and can be used to provide context for the changes made.

external_hrefstring

An external URL to associate with the diff scan. This can be a link to a pull request, issue, or any other relevant resource.

mergeboolean

Set to true when running a diff between a merged commit and its parent commit in the same branch. Set to false when running diffs in an open PR between unmerged commits.

on_duplicatestring

Set to "redirect" to receive a 302 redirect to the existing diff scan instead of a 409 error when a duplicate is detected. Set to "update" to apply the supplied external_href to the existing diff scan and receive it in a 200 response; when external_href is omitted, the existing value is left untouched.

Response

The existing diff scan when on_duplicate=update is set and a duplicate is detected. If external_href was supplied, it has been applied to the diff scan.

Changes