Socket diff-scans API
The diff-scans API from Socket — 7 operation(s) for diff-scans.
The diff-scans API from Socket — 7 operation(s) for diff-scans.
openapi: 3.0.0
info:
description: Specification of the Socket API endpoints
title: API Endpoints alerts diff-scans API
version: '0'
servers:
- url: https://api.socket.dev/v0
tags:
- name: diff-scans
paths:
/orgs/{org_slug}/diff-scans:
get:
tags:
- diff-scans
summary: List diff scans
operationId: listOrgDiffScans
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: sort
in: query
required: false
description: Specify sort field.
schema:
type: string
enum:
- created_at
- updated_at
default: created_at
- name: direction
in: query
required: false
description: Specify sort direction.
schema:
type: string
enum:
- asc
- desc
default: desc
- name: per_page
in: query
required: false
description: Specify the maximum number of results to return per page.
schema:
type: integer
minimum: 1
maximum: 100
default: 20
- name: cursor
in: query
required: false
description: Cursor for pagination. Use the next_cursor or prev_cursor from previous responses.
schema:
type: string
- name: repository_id
in: query
required: false
description: Filter by repository ID.
schema:
type: string
- name: before_full_scan_id
in: query
required: false
description: Filter by before full scan ID.
schema:
type: string
- name: after_full_scan_id
in: query
required: false
description: Filter by after full scan ID.
schema:
type: string
security:
- bearerAuth:
- diff-scans:list
- basicAuth:
- diff-scans:list
description: 'Returns a paginated list of all diff scans in an organization.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- diff-scans:list'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
results:
type: array
items:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: ''
default: ''
organization_id:
type: string
description: ''
default: ''
repository_id:
type: string
description: ''
default: ''
created_at:
type: string
description: ''
default: ''
updated_at:
type: string
description: ''
default: ''
before_full_scan_id:
type: string
description: ''
default: ''
after_full_scan_id:
type: string
description: ''
default: ''
description:
type: string
description: ''
default: ''
nullable: true
external_href:
type: string
description: ''
default: ''
nullable: true
merge:
type: boolean
default: false
description: ''
html_url:
type: string
description: ''
default: ''
nullable: true
api_url:
type: string
description: ''
default: ''
nullable: true
required:
- after_full_scan_id
- api_url
- before_full_scan_id
- created_at
- description
- external_href
- html_url
- id
- merge
- organization_id
- repository_id
- updated_at
description: ''
next_page_href:
type: string
description: ''
default: ''
nullable: true
next_cursor:
type: string
description: ''
default: ''
nullable: true
required:
- next_cursor
- next_page_href
- results
description: Lists diff scans for the specified organization.
'400':
$ref: '#/components/responses/SocketBadRequest'
'401':
$ref: '#/components/responses/SocketUnauthorized'
'403':
$ref: '#/components/responses/SocketForbidden'
'404':
$ref: '#/components/responses/SocketNotFoundResponse'
'429':
$ref: '#/components/responses/SocketTooManyRequestsResponse'
x-readme: {}
/orgs/{org_slug}/diff-scans/{diff_scan_id}:
get:
tags:
- diff-scans
summary: Get diff scan
operationId: getDiffScanById
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: diff_scan_id
in: path
required: true
description: The ID of the diff scan
schema:
type: string
format: uuid
- name: omit_license_details
in: query
required: false
description: Omit license details in the response. This can reduce the size of the response significantly, but will not include license information for the artifacts.
schema:
type: boolean
default: false
- name: omit_unchanged
in: query
required: false
description: Omit unchanged artifacts from the response. When set to true, the unchanged field will be set to null.
schema:
type: boolean
default: false
- name: cached
in: query
required: false
description: 'Return cached immutable scan results. When enabled and results are cached, returns the pre-computed scan. When results are not yet cached, returns 202 Accepted and enqueues a background job. Note: When cached=true, the omit_license_details parameter is ignored as cached results always includes license details.'
schema:
type: boolean
default: false
security:
- bearerAuth:
- diff-scans:list
- basicAuth:
- diff-scans:list
description: 'Get the difference between two full scans from an existing diff scan resource.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- diff-scans:list'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
diff_scan:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: The ID of the diff scan.
default: ''
organization_id:
type: string
description: The ID of the organization that owns the diff scan.
default: ''
repository_id:
type: string
description: The ID of the repository the diff scan was run against.
default: ''
created_at:
type: string
description: ISO 8601 timestamp of when the diff scan was created.
default: ''
updated_at:
type: string
description: ISO 8601 timestamp of when the diff scan was last updated.
default: ''
before_full_scan:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: ''
default: ''
created_at:
type: string
description: ''
default: ''
updated_at:
type: string
description: ''
default: ''
organization_id:
type: string
description: ''
default: ''
organization_slug:
type: string
description: ''
default: ''
repository_id:
type: string
description: ''
default: ''
repository_slug:
type: string
description: ''
default: ''
branch:
type: string
description: ''
default: ''
nullable: true
commit_message:
type: string
description: ''
default: ''
nullable: true
commit_hash:
type: string
description: ''
default: ''
nullable: true
pull_request:
type: integer
description: ''
default: 0
nullable: true
committers:
type: array
items:
type: string
description: ''
default: ''
description: ''
html_url:
type: string
description: ''
default: ''
nullable: true
api_url:
type: string
description: ''
default: ''
nullable: true
required:
- api_url
- branch
- commit_hash
- commit_message
- committers
- created_at
- html_url
- id
- organization_id
- organization_slug
- pull_request
- repository_id
- repository_slug
- updated_at
after_full_scan:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: ''
default: ''
created_at:
type: string
description: ''
default: ''
updated_at:
type: string
description: ''
default: ''
organization_id:
type: string
description: ''
default: ''
organization_slug:
type: string
description: ''
default: ''
repository_id:
type: string
description: ''
default: ''
repository_slug:
type: string
description: ''
default: ''
branch:
type: string
description: ''
default: ''
nullable: true
commit_message:
type: string
description: ''
default: ''
nullable: true
commit_hash:
type: string
description: ''
default: ''
nullable: true
pull_request:
type: integer
description: ''
default: 0
nullable: true
committers:
type: array
items:
type: string
description: ''
default: ''
description: ''
html_url:
type: string
description: ''
default: ''
nullable: true
api_url:
type: string
description: ''
default: ''
nullable: true
required:
- api_url
- branch
- commit_hash
- commit_message
- committers
- created_at
- html_url
- id
- organization_id
- organization_slug
- pull_request
- repository_id
- repository_slug
- updated_at
description:
type: string
description: Human readable description of the diff scan, e.g. the pull request title.
default: ''
nullable: true
external_href:
type: string
description: Link to the external resource the diff scan was created for, e.g. the pull request URL.
default: ''
nullable: true
merge:
type: boolean
default: false
description: True when the diff scan was created for a merge event rather than an open pull request.
html_url:
type: string
description: Link to the diff scan report in the Socket dashboard.
default: ''
nullable: true
api_url:
type: string
description: Link to the diff scan resource in the Socket API.
default: ''
nullable: true
incomplete:
type: boolean
default: false
description: True when either side of the diff was truncated at the plan's dependency limit. A truncated diff is imbalanced and can report changes for artifacts the change never touched, so treat the artifact lists as unreliable when this is set.
artifacts:
type: object
additionalProperties: false
description: Artifacts in the diff grouped by how they changed between the before and after scans.
properties:
added:
type: array
items:
$ref: '#/components/schemas/SocketDiffArtifact'
description: Artifacts present in the after scan but not the before scan.
removed:
type: array
items:
$ref: '#/components/schemas/SocketDiffArtifact'
description: Artifacts present in the before scan but not the after scan.
unchanged:
type: array
items:
$ref: '#/components/schemas/SocketDiffArtifact'
description: Artifacts present in both scans with no changes. Null when omitted via the omit_unchanged query parameter.
nullable: true
replaced:
type: array
items:
$ref: '#/components/schemas/SocketDiffArtifact'
description: Artifacts replaced between the scans, e.g. the same package supplied by a different source.
updated:
type: array
items:
$ref: '#/components/schemas/SocketDiffArtifact'
description: Artifacts whose version changed between the scans.
required:
- added
- removed
- replaced
- unchanged
- updated
required:
- after_full_scan
- api_url
- artifacts
- before_full_scan
- created_at
- description
- external_href
- html_url
- id
- incomplete
- merge
- organization_id
- repository_id
- updated_at
required:
- diff_scan
description: The difference between the two Full Scans in the diff scan.
'202':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
status:
type: string
description: ''
default: processing
id:
type: string
description: ''
default: ''
required:
- id
- status
description: Scan is being processed. Poll again later to retrieve results.
'400':
$ref: '#/components/responses/SocketBadRequest'
'401':
$ref: '#/components/responses/SocketUnauthorized'
'403':
$ref: '#/components/responses/SocketForbidden'
'404':
$ref: '#/components/responses/SocketNotFoundResponse'
'429':
$ref: '#/components/responses/SocketTooManyRequestsResponse'
x-readme: {}
delete:
tags:
- diff-scans
summary: Delete diff scan
operationId: deleteOrgDiffScan
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: diff_scan_id
in: path
required: true
description: The ID of the diff scan
schema:
type: string
format: uuid
security:
- bearerAuth:
- diff-scans:delete
- basicAuth:
- diff-scans:delete
description: 'Delete an existing diff scan.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- diff-scans:delete'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
status:
type: string
description: ''
default: ok
required:
- status
description: Success
'400':
$ref: '#/components/responses/SocketBadRequest'
'401':
$ref: '#/components/responses/SocketUnauthorized'
'403':
$ref: '#/components/responses/SocketForbidden'
'404':
$ref: '#/components/responses/SocketNotFoundResponse'
'429':
$ref: '#/components/responses/SocketTooManyRequestsResponse'
x-readme: {}
/orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm:
get:
tags:
- diff-scans
summary: SCM Comment for Diff Scan
operationId: GetDiffScanGfm
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: diff_scan_id
in: path
required: true
description: The ID of the diff scan
schema:
type: string
format: uuid
- name: github_installation_id
in: query
required: false
description: The ID of the GitHub installation. This will be used to get the GitHub installation settings. If not provided, the default GitHub installation settings will be used.
schema:
type: string
security:
- bearerAuth:
- diff-scans:list
- basicAuth:
- diff-scans:list
description: 'Get the dependency overview and dependency alert comments in GitHub flavored markdown for an existing diff scan.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- diff-scans:list'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
diff_scan:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: The ID of the diff scan.
default: ''
organization_id:
type: string
description: The ID of the organization that owns the diff scan.
default: ''
repository_id:
type: string
description: The ID of the repository the diff scan was run against.
default: ''
created_at:
type: string
description: ISO 8601 timestamp of when the diff scan was created.
default: ''
updated_at:
type: string
description: ISO 8601 timestamp of when the diff scan was last updated.
default: ''
before_full_scan:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: ''
default: ''
created_at:
type: string
description: ''
default: ''
updated_at:
type: string
description: ''
default: ''
organization_id:
type: string
description: ''
default: ''
organization_slug:
type: string
description: ''
default: ''
repository_id:
type: string
description: ''
default: ''
repository_slug:
type: string
description: ''
default: ''
branch:
type: string
description: ''
default: ''
nullable: true
commit_message:
type: string
description: ''
default: ''
nullable: true
commit_hash:
type: string
description: ''
default: ''
nullable: true
pull_request:
type: integer
description: ''
default: 0
nullable: true
committers:
type: array
items:
type: string
description: ''
default: ''
description: ''
html_url:
type: string
description: ''
default: ''
nullable: true
api_url:
type: string
description: ''
default: ''
nullable: true
required:
- api_url
- branch
- commit_hash
- commit_message
- committers
- created_at
- html_url
- id
- organization_id
- organization_slug
- pull_request
- repository_id
- repository_slug
- updated_at
after_full_scan:
type: object
additionalProperties: false
description: ''
properties:
id:
type: string
description: ''
default: ''
created_at:
type: string
description: ''
default: ''
updated_at:
type: string
description: ''
default: ''
organization_id:
type: string
description: ''
default: ''
organization_slug:
type: string
description: ''
default: ''
repository_id:
type: string
description: ''
default: ''
repository_slug:
type: string
description: ''
default: ''
branch:
type: string
description: ''
default: ''
nullable: true
commit_message:
type: string
description: ''
default: ''
nullable: true
commit_hash:
type: string
description: ''
default: ''
nullable: true
pull_request:
type: integer
description: ''
default: 0
nullable: true
committers:
type: array
items:
type: string
description: ''
default: ''
description: ''
html_url:
type: string
description: ''
default: ''
nullable: true
api_url:
type: string
description: ''
default: ''
nullable: true
required:
- api_url
- branch
- commit_hash
- commit_message
- committers
- created_at
- html_url
- id
- organization_id
- organization_slug
- pull_request
- repository_id
- repository_slug
- updated_at
# --- truncated at 32 KB (108 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/socket/refs/heads/main/openapi/socket-diff-scans-api-openapi.yml