Skip to content

Latest commit

 

History

History
2040 lines (1443 loc) · 50.1 KB

File metadata and controls

2040 lines (1443 loc) · 50.1 KB

API Reference

Every public method on SocketSdk, grouped by domain. For the runtime model (result shape, pagination, file uploads, escape hatches), see SDK Concepts. For quota planning, see Quota Management.

There are 135 public methods.

Contents

Full scans

Create, fetch, list, and delete organization-level full security scans.

createFullScan

Create a full security scan for an organization.

async createFullScan(
  orgSlug: string,
  filepaths: string[],
  options: CreateFullScanOptions,
): Promise<FullScanResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: CreateOrgFullScan · Permissions: full-scans:create

createFullScanFromManifest

Create a full scan from a pre-built content-addressed manifest (v1 API,

async createFullScanFromManifest(
  orgSlug: string,
  manifest: FullScanManifest,
  params: CreateFullScanFromManifestParams,
): Promise<CreateFullScanFromManifestResult | StrictErrorResult>

Quota: not tracked

createOrgFullScanFromArchive

Create a full scan from an archive file (.tar, .tar.gz/.tgz, or .zip).

Signature
async createOrgFullScanFromArchive(
  orgSlug: string,
  archivePath: string,
  options: {
    branch?: string | undefined
    commit_hash?: string | undefined
    commit_message?: string | undefined
    committers?: string | undefined
    integration_org_slug?: string | undefined
    integration_type?:
      | 'api'
      | 'azure'
      | 'bitbucket'
      | 'github'
      | 'gitlab'
      | 'web'
      | undefined
    make_default_branch?: boolean | undefined
    pull_request?: number | undefined
    repo: string
    scan_type?: string | undefined
    set_as_pending_head?: boolean | undefined
    tmp?: boolean | undefined
    workspace?: string | undefined
  },
): Promise<SocketSdkResult<'CreateOrgFullScanArchive'>>

Quota: not tracked · OpenAPI: CreateOrgFullScanArchive

uploadBlobs

Upload blobs to an organization's content-addressed blob store (v1 API,

async uploadBlobs(
  orgSlug: string,
  entries: BlobUploadEntry[],
): Promise<UploadBlobsResult | StrictErrorResult>

Quota: not tracked

getFullScan

Get complete full scan results buffered in memory.

async getFullScan(
  orgSlug: string,
  scanId: string,
  options?:
    | {
        cached?: boolean | undefined
        include_license_details?: boolean | undefined
        include_scores?: boolean | undefined
      }
    | undefined,
): Promise<FullScanResult | StrictErrorResult>

Quota: not tracked · OpenAPI: getOrgFullScan

getOrgFullScanV1

Read advanced v1 scan processing, complete, or failed state.

async getOrgFullScanV1(
  orgSlug: string,
  fullScanId: string,
): ReturnType<typeof getOrgFullScanV1>

Quota: not tracked

pollOrgFullScanV1

Poll advanced v1 scan processing until a terminal state.

async pollOrgFullScanV1(
  orgSlug: string,
  fullScanId: string,
  options?: PollFullScanV1Options | undefined,
): ReturnType<typeof pollOrgFullScanV1>

Quota: not tracked

getFullScanMetadata

Get metadata for a specific full scan.

async getFullScanMetadata(
  orgSlug: string,
  scanId: string,
): Promise<FullScanResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrgFullScanMetadata · Permissions: full-scans:list

listFullScans

List all full scans for an organization.

async listFullScans(
  orgSlug: string,
  options?: ListFullScansOptions | undefined,
): Promise<FullScanListResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrgFullScanList · Permissions: full-scans:list

streamFullScan

Stream a full scan's results to a file, to stdout, or to the caller.

async streamFullScan(
  orgSlug: string,
  scanId: string,
  options?: StreamOrgFullScanOptions | undefined,
): Promise<SocketSdkResult<'getOrgFullScan'>>

Quota: not tracked · OpenAPI: getOrgFullScan

downloadOrgFullScanFilesAsTar

Download full scan files as a tar archive.

async downloadOrgFullScanFilesAsTar(
  orgSlug: string,
  fullScanId: string,
  outputPath: string,
): Promise<SocketSdkResult<'downloadOrgFullScanFilesAsTar'>>

Quota: 1 (1 units) · OpenAPI: downloadOrgFullScanFilesAsTar · Permissions: full-scans:list

getOrgFullScanCsv

Export a full scan's alerts as CSV. The endpoint responds with raw

async getOrgFullScanCsv(
  orgSlug: string,
  fullScanId: string,
  options: GetOrgFullScanCsvOptions,
): Promise<SocketSdkGenericResult<string>>

Quota: 1 (1 units) · OpenAPI: getOrgFullScanCsv · Permissions: full-scans:list

getOrgFullScanPdf

Export a full scan's alerts as a PDF report. The endpoint responds with raw

async getOrgFullScanPdf(
  orgSlug: string,
  fullScanId: string,
  options: GetOrgFullScanPdfOptions,
): Promise<SocketSdkGenericResult<Buffer>>

Quota: 1 (1 units) · OpenAPI: getOrgFullScanPdf · Permissions: full-scans:list

rescanFullScan

Create a new full scan by rescanning an existing scan. Supports shallow

async rescanFullScan(
  orgSlug: string,
  fullScanId: string,
  options?:
    | {
        mode?: 'shallow' | 'deep' | undefined
      }
    | undefined,
): Promise<SocketSdkResult<'rescanOrgFullScan'>>

Quota: not tracked · OpenAPI: rescanOrgFullScan

deleteFullScan

Delete a full scan from an organization.

async deleteFullScan(
  orgSlug: string,
  scanId: string,
): Promise<DeleteResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: deleteOrgFullScan · Permissions: full-scans:delete

Diff scans

Compare two scans and inspect the diff.

createOrgDiffScanFromIds

Create a diff scan from two full scan IDs. Compares two existing full scans

async createOrgDiffScanFromIds(
  orgSlug: string,
  options: {
    after: string
    before: string
    description?: string | undefined
    external_href?: string | undefined
    merge?: boolean | undefined
    on_duplicate?: string | undefined
  },
): Promise<SocketSdkResult<'createOrgDiffScanFromIds'>>

Quota: 1 (1 units) · OpenAPI: createOrgDiffScanFromIds · Permissions: diff-scans:create, full-scans:list

createOrgRepoDiff

Create a diff scan between a repository's current HEAD full scan and a new

async createOrgRepoDiff(
  orgSlug: string,
  repoSlug: string,
  filepaths: string[],
  options?: CreateOrgRepoDiffOptions | undefined,
): Promise<SocketSdkResult<'createOrgRepoDiff'>>

Quota: 1 (1 units) · OpenAPI: createOrgRepoDiff · Permissions: repo:list, diff-scans:create, full-scans:create

getDiffScanById

Get details for a specific diff scan. Returns comparison between two full

async getDiffScanById(
  orgSlug: string,
  diffScanId: string,
  options?:
    | {
        cached?: boolean | undefined
        omit_license_details?: boolean | undefined
        omit_unchanged?: boolean | undefined
      }
    | undefined,
): Promise<SocketSdkResult<'getDiffScanById'>>

Quota: 1 (1 units) · OpenAPI: getDiffScanById · Permissions: diff-scans:list

getDiffScanGfm

Get GitHub-flavored markdown comments for a diff scan. Returns dependency

async getDiffScanGfm(
  orgSlug: string,
  diffScanId: string,
  options?: { github_installation_id?: string | undefined } | undefined,
): Promise<SocketSdkResult<'GetDiffScanGfm'>>

Quota: 1 (1 units) · OpenAPI: GetDiffScanGfm · Permissions: diff-scans:list

listOrgDiffScans

List all diff scans for an organization. Returns paginated list of diff

async listOrgDiffScans(
  orgSlug: string,
): Promise<SocketSdkResult<'listOrgDiffScans'>>

Quota: 1 (1 units) · OpenAPI: listOrgDiffScans · Permissions: diff-scans:list

deleteOrgDiffScan

Delete a diff scan from an organization. Permanently removes diff scan data

async deleteOrgDiffScan(
  orgSlug: string,
  diffScanId: string,
): Promise<SocketSdkResult<'deleteOrgDiffScan'>>

Quota: 1 (1 units) · OpenAPI: deleteOrgDiffScan · Permissions: diff-scans:delete

Repositories

Manage repositories tracked by the organization.

createRepository

Create a new repository in an organization.

async createRepository(
  orgSlug: string,
  repoSlug: string,
  params?:
    | {
        archived?: boolean | undefined
        default_branch?: null | string | undefined
        description?: null | string | undefined
        homepage?: null | string | undefined
        visibility?: 'private' | 'public' | undefined
        workspace?: string | undefined
      }
    | undefined,
): Promise<RepositoryResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: createOrgRepo · Permissions: repo:create

getRepository

Get details for a specific repository.

async getRepository(
  orgSlug: string,
  repoSlug: string,
  options?: GetRepositoryOptions | undefined,
): Promise<RepositoryResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrgRepo · Permissions: repo:list

listRepositories

List all repositories in an organization.

async listRepositories(
  orgSlug: string,
  options?: ListRepositoriesOptions | undefined,
): Promise<RepositoriesListResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrgRepoList · Permissions: repo:list

updateRepository

Update configuration for a repository.

async updateRepository(
  orgSlug: string,
  repoSlug: string,
  params: QueryParams,
  options?: GetRepositoryOptions | undefined,
): Promise<RepositoryResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: updateOrgRepo · Permissions: repo:update

deleteRepository

Delete a repository from an organization.

async deleteRepository(
  orgSlug: string,
  repoSlug: string,
  options?: GetRepositoryOptions | undefined,
): Promise<DeleteResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: deleteOrgRepo · Permissions: repo:delete

Repository labels

Per-repo labels for filtering and grouping.

createRepositoryLabel

Create a new repository label for an organization.

async createRepositoryLabel(
  orgSlug: string,
  labelData: QueryParams,
): Promise<RepositoryLabelResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: createOrgRepoLabel · Permissions: repo-label:create

getRepositoryLabel

Get details for a specific repository label.

async getRepositoryLabel(
  orgSlug: string,
  labelId: string,
): Promise<RepositoryLabelResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrgRepoLabel · Permissions: repo-label:list

listRepositoryLabels

List all repository labels for an organization.

async listRepositoryLabels(
  orgSlug: string,
  options?: QueryParams | undefined,
): Promise<RepositoryLabelsListResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrgRepoLabelList · Permissions: repo-label:list

updateRepositoryLabel

Update a repository label for an organization.

async updateRepositoryLabel(
  orgSlug: string,
  labelId: string,
  labelData: QueryParams,
): Promise<RepositoryLabelResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: updateOrgRepoLabel · Permissions: repo-label:update

deleteRepositoryLabel

Delete a repository label from an organization.

async deleteRepositoryLabel(
  orgSlug: string,
  labelId: string,
): Promise<DeleteRepositoryLabelResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: deleteOrgRepoLabel · Permissions: repo-label:delete

associateOrgRepoLabel

Associate a repository with an organization repository label.

async associateOrgRepoLabel(
  orgSlug: string,
  labelId: string,
  repositoryId: string,
): Promise<SocketSdkResult<'associateOrgRepoLabel'>>

Quota: 1 (1 units) · OpenAPI: associateOrgRepoLabel · Permissions: repo-label:update

disassociateOrgRepoLabel

Disassociate a repository from an organization repository label.

async disassociateOrgRepoLabel(
  orgSlug: string,
  labelId: string,
  repositoryId: string,
): Promise<SocketSdkResult<'disassociateOrgRepoLabel'>>

Quota: 1 (1 units) · OpenAPI: disassociateOrgRepoLabel · Permissions: repo-label:update

getOrgRepoLabelSetting

Get a single setting for a repository label.

async getOrgRepoLabelSetting(
  orgSlug: string,
  labelId: string,
  settingKey: string,
): Promise<SocketSdkResult<'getOrgRepoLabelSetting'>>

Quota: 1 (1 units) · OpenAPI: getOrgRepoLabelSetting · Permissions: repo-label:list

updateOrgRepoLabelSetting

Update the settings for a repository label. Accepts the structured

async updateOrgRepoLabelSetting(
  orgSlug: string,
  labelId: string,
  settings: UpdateOrgRepoLabelSettingBody,
): Promise<SocketSdkResult<'updateOrgRepoLabelSetting'>>

Quota: 1 (1 units) · OpenAPI: updateOrgRepoLabelSetting · Permissions: repo-label:update

deleteOrgRepoLabelSetting

Delete a single setting from a repository label.

async deleteOrgRepoLabelSetting(
  orgSlug: string,
  labelId: string,
  settingKey: string,
): Promise<SocketSdkResult<'deleteOrgRepoLabelSetting'>>

Quota: 1 (1 units) · OpenAPI: deleteOrgRepoLabelSetting · Permissions: repo-label:update

Organizations

Org listing, analytics, and entitlements.

listOrganizations

List all organizations accessible to the current user.

async listOrganizations(): Promise<OrganizationsResult | StrictErrorResult>

Quota: 1 (1 units) · OpenAPI: getOrganizations

getOrgAnalytics

Get analytics data for organization usage patterns and security metrics.

async getOrgAnalytics(
  time: string,
): Promise<SocketSdkResult<'getOrgAnalytics'>>

Quota: 1 (1 units) · OpenAPI: getOrgAnalytics · Permissions: report:write

getRepoAnalytics

Get analytics data for a specific repository. Returns security metrics,

async getRepoAnalytics(
  repo: string,
  time: string,
): Promise<SocketSdkResult<'getRepoAnalytics'>>

Quota: 1 (1 units) · OpenAPI: getRepoAnalytics · Permissions: report:write

getEnabledEntitlements

Retrieve the enabled entitlements for an organization.

async getEnabledEntitlements(orgSlug: string): Promise<string[]>

Quota: 0 (Free) · OpenAPI: getEnabledEntitlements

getEntitlements

Retrieve all entitlements for an organization.

async getEntitlements(orgSlug: string): Promise<Entitlement[]>

Quota: 0 (Free) · OpenAPI: getEntitlements

Alerts and triage

Surface and triage alerts across an organization.

getOrgAlertsList

List latest alerts for an organization (Beta). Returns paginated alerts

Signature
async getOrgAlertsList(
  orgSlug: string,
  options?:
    | {
        'filters.alertAction'?: string | undefined
        'filters.alertAction.notIn'?: string | undefined
        'filters.alertCategory'?: string | undefined
        'filters.alertCategory.notIn'?: string | undefined
        'filters.alertCveId'?: string | undefined
        'filters.alertCveId.notIn'?: string | undefined
        'filters.alertCveTitle'?: string | undefined
        'filters.alertCveTitle.notIn'?: string | undefined
        'filters.alertCweId'?: string | undefined
        'filters.alertCweId.notIn'?: string | undefined
        'filters.alertCweName'?: string | undefined
        'filters.alertCweName.notIn'?: string | undefined
        'filters.alertEPSS'?: string | undefined
        'filters.alertEPSS.notIn'?: string | undefined
        'filters.alertFixType'?: string | undefined
        'filters.alertFixType.notIn'?: string | undefined
        'filters.alertKEV'?: boolean | undefined
        'filters.alertKEV.notIn'?: boolean | undefined
        'filters.alertPriority'?: string | undefined
        'filters.alertPriority.notIn'?: string | undefined
        'filters.alertReachabilityType'?: string | undefined
        'filters.alertReachabilityType.notIn'?: string | undefined
        'filters.alertSeverity'?: string | undefined
        'filters.alertSeverity.notIn'?: string | undefined
        'filters.alertStatus'?: string | undefined
        'filters.alertStatus.notIn'?: string | undefined
        'filters.alertType'?: string | undefined
        'filters.alertType.notIn'?: string | undefined
        'filters.alertUpdatedAt.eq'?: string | undefined
        'filters.alertUpdatedAt.gt'?: string | undefined
        'filters.alertUpdatedAt.gte'?: string | undefined
        'filters.alertUpdatedAt.lt'?: string | undefined
        'filters.alertUpdatedAt.lte'?: string | undefined
        'filters.repoFullName'?: string | undefined
        'filters.repoFullName.notIn'?: string | undefined
        'filters.repoLabels'?: string | undefined
        'filters.repoLabels.notIn'?: string | undefined
        'filters.repoSlug'?: string | undefined
        'filters.repoSlug.notIn'?: string | undefined
        per_page?: number | undefined
        startAfterCursor?: string | undefined
      }
    | undefined,
): Promise<SocketSdkResult<'alertsList'>>

Quota: not tracked · OpenAPI: alertsList

getOrgAlertFullScans

List full scans associated with a specific alert. Returns paginated full

async getOrgAlertFullScans(
  orgSlug: string,
  options: {
    alertKey: string
    per_page?: number | undefined
    range?: string | undefined
    startAfterCursor?: string | undefined
  },
): Promise<SocketSdkResult<'alertFullScans'>>

Quota: not tracked · OpenAPI: alertFullScans

getOrgAlertResolutions

List active alert resolutions for an organization. Results are

async getOrgAlertResolutions(
  orgSlug: string,
  options?:
    | {
        direction?: string | undefined
        per_page?: number | undefined
        startAfterCursor?: string | undefined
      }
    | undefined,
): Promise<SocketSdkResult<'getOrgAlertResolutions'>>

Quota: 1 (1 units) · OpenAPI: getOrgAlertResolutions · Permissions: alert-resolution:list

createOrgAlertResolution

Create organization alert resolution.

async createOrgAlertResolution(
  orgSlug: string,
  body: CreateOrgAlertResolutionBody,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestCreateOrgAlertResolution>

Quota: 1 (1 units) · OpenAPI: createOrgAlertResolution · Permissions: alert-resolution:create

getOrgAlertResolution

Fetch a single active alert resolution by UUID. Returns the same row

async getOrgAlertResolution(
  orgSlug: string,
  uuid: string,
): Promise<SocketSdkResult<'getOrgAlertResolution'>>

Quota: 1 (1 units) · OpenAPI: getOrgAlertResolution · Permissions: alert-resolution:read

deleteOrgAlertResolution

Delete an alert resolution by UUID. Once deleted, alerts previously

async deleteOrgAlertResolution(
  orgSlug: string,
  uuid: string,
): Promise<SocketSdkResult<'deleteOrgAlertResolution'>>

Quota: 1 (1 units) · OpenAPI: deleteOrgAlertResolution · Permissions: alert-resolution:delete

getOrgTriage

Get organization triage settings and status. Returns alert triage

async getOrgTriage(
  orgSlug: string,
): Promise<SocketSdkResult<'getOrgTriage'>>

Quota: 1 (1 units) · OpenAPI: getOrgTriage · Permissions: triage:alerts-list

updateOrgAlertTriage

Update alert triage status for an organization. Modifies alert resolution

async updateOrgAlertTriage(
  orgSlug: string,
  alertId: string,
  triageData: QueryParams,
): Promise<SocketSdkResult<'updateOrgAlertTriage'>>

Quota: 1 (1 units) · OpenAPI: updateOrgAlertTriage · Permissions: triage:alerts-update

deleteOrgAlertTriage

Delete a triage entry for a specific alert in an organization. Removes the

async deleteOrgAlertTriage(
  orgSlug: string,
  uuid: string,
): Promise<SocketSdkResult<'deleteOrgAlertTriage'>>

Quota: 1 (1 units) · OpenAPI: deleteOrgAlertTriage · Permissions: triage:alerts-update

getOrgFixes

Fetch available fixes for vulnerabilities in a repository or scan. Returns

async getOrgFixes(
  orgSlug: string,
  options: OrgFixesOptions,
): ReturnType<typeof requestOrgFixes>

Quota: 10 (Standard) · OpenAPI: getOrgFixes · Permissions: fixes:list

startOrgFixComputation

Start an advanced fix computation.

async startOrgFixComputation(
  orgSlug: string,
  options: OrgFixesOptions,
): ReturnType<typeof requestStartOrgFixComputation>

Quota: 10 (Standard) · OpenAPI: startOrgFixComputation · Permissions: fixes:list

getOrgFixComputation

Read an advanced fix computation.

async getOrgFixComputation(
  orgSlug: string,
  computationId: string,
): ReturnType<typeof requestOrgFixComputation>

Quota: 0 (Free) · OpenAPI: getOrgFixComputation · Permissions: fixes:list

Historical and analytics

Point-in-time alert and dependency history, trends, and snapshots.

historicalAlertsList

List historical alerts for an organization. Returns point-in-time alert

async historicalAlertsList(
  orgSlug: string,
  options?: HistoricalAlertsListOptions | undefined,
): Promise<SocketSdkResult<'historicalAlertsList'>>

Quota: 10 (Standard) · OpenAPI: historicalAlertsList · Permissions: historical:alerts-list

historicalAlertsTrend

Get a trend of historical alert counts for an organization. Returns

async historicalAlertsTrend(
  orgSlug: string,
  options?: HistoricalAlertsTrendOptions | undefined,
): Promise<SocketSdkResult<'historicalAlertsTrend'>>

Quota: 10 (Standard) · OpenAPI: historicalAlertsTrend · Permissions: historical:alerts-trend

historicalDependenciesTrend

Get a trend of historical dependency counts for an organization. Returns

async historicalDependenciesTrend(
  orgSlug: string,
  options?: HistoricalDependenciesTrendOptions | undefined,
): Promise<SocketSdkResult<'historicalDependenciesTrend'>>

Quota: 10 (Standard) · OpenAPI: historicalDependenciesTrend · Permissions: historical:dependencies-trend

historicalSnapshotsList

List historical dependency snapshots for an organization. Returns snapshot

async historicalSnapshotsList(
  orgSlug: string,
  options?: HistoricalSnapshotsListOptions | undefined,
): Promise<SocketSdkResult<'historicalSnapshotsList'>>

Quota: 10 (Standard) · OpenAPI: historicalSnapshotsList · Permissions: historical:snapshots-list

historicalSnapshotsStart

Start a new historical dependency snapshot for an organization. Triggers

async historicalSnapshotsStart(
  orgSlug: string,
): Promise<SocketSdkResult<'historicalSnapshotsStart'>>

Quota: 10 (Standard) · OpenAPI: historicalSnapshotsStart · Permissions: historical:snapshots-start

Webhooks

Manage outbound webhooks for organization events.

createOrgWebhook

Create a new webhook for an organization. Webhooks allow you to receive

async createOrgWebhook(
  orgSlug: string,
  webhookData: {
    description?: null | string | undefined
    events: string[]
    filters?: { repositoryIds: null | string[] } | null | undefined
    headers?: null | Record<string, unknown> | undefined
    name: string
    secret: string
    url: string
  },
): Promise<SocketSdkResult<'createOrgWebhook'>>

Quota: 1 (1 units) · OpenAPI: createOrgWebhook · Permissions: webhooks:create

getOrgWebhook

Get details of a specific webhook. Returns webhook configuration including

async getOrgWebhook(
  orgSlug: string,
  webhookId: string,
): Promise<SocketSdkResult<'getOrgWebhook'>>

Quota: 1 (1 units) · OpenAPI: getOrgWebhook · Permissions: webhooks:list

getOrgWebhooksList

List all webhooks for an organization. Supports pagination and sorting

async getOrgWebhooksList(
  orgSlug: string,
  options?:
    | {
        direction?: string | undefined
        page?: number | undefined
        per_page?: number | undefined
        sort?: string | undefined
      }
    | undefined,
): Promise<SocketSdkResult<'getOrgWebhooksList'>>

Quota: 1 (1 units) · OpenAPI: getOrgWebhooksList · Permissions: webhooks:list

updateOrgWebhook

Update an existing webhook's configuration. All fields are optional - only

async updateOrgWebhook(
  orgSlug: string,
  webhookId: string,
  webhookData: {
    description?: null | string | undefined
    events?: string[] | undefined
    filters?: { repositoryIds: null | string[] } | null | undefined
    headers?: null | Record<string, unknown> | undefined
    name?: string | undefined
    secret?: null | string | undefined
    url?: string | undefined
  },
): Promise<SocketSdkResult<'updateOrgWebhook'>>

Quota: 1 (1 units) · OpenAPI: updateOrgWebhook · Permissions: webhooks:update

deleteOrgWebhook

Delete a webhook from an organization. This will stop all future webhook

async deleteOrgWebhook(
  orgSlug: string,
  webhookId: string,
): Promise<SocketSdkResult<'deleteOrgWebhook'>>

Quota: 1 (1 units) · OpenAPI: deleteOrgWebhook · Permissions: webhooks:delete

Patches

Browse and download Socket security patches.

viewPatch

View detailed information about a specific patch by its UUID.

async viewPatch(orgSlug: string, uuid: string): Promise<PatchViewResponse>

Quota: 10 (Standard) · OpenAPI: viewPatch

downloadPatch

Download patch file content from Socket blob storage. Retrieves patched

async downloadPatch(
  hash: string,
  options?: { baseUrl?: string | undefined } | undefined,
): Promise<string>

Quota: not tracked

downloadOrgPatchVerificationBundle

Download an advanced verification bundle as gzip bytes.

async downloadOrgPatchVerificationBundle(
  orgSlug: string,
  uuid: string,
): ReturnType<typeof downloadOrgPatchVerificationBundle>

Quota: 10 (Standard) · OpenAPI: downloadOrgPatchVerificationBundle

streamPatchesFromScan

Stream patches for artifacts in a scan report.

async streamPatchesFromScan(
  orgSlug: string,
  scanId: string,
): Promise<ReadableStream<ArtifactPatches>>

Quota: 100 (Expensive) · OpenAPI: streamPatchesFromScan

API tokens

Provision, rotate, and revoke API tokens for the organization.

getAPITokens

Get list of API tokens for an organization. Returns organization API tokens

async getAPITokens(
  orgSlug: string,
): Promise<SocketSdkResult<'getAPITokens'>>

Quota: 10 (Standard) · OpenAPI: getAPITokens · Permissions: api-tokens:list

postAPIToken

Create a new API token for an organization. Generates API token with

async postAPIToken(
  orgSlug: string,
  tokenData: QueryParams,
): Promise<SocketSdkResult<'postAPIToken'>>

Quota: 10 (Standard) · OpenAPI: postAPIToken · Permissions: api-tokens:create

postAPITokenUpdate

Update an existing API token for an organization. Modifies token metadata,

async postAPITokenUpdate(
  orgSlug: string,
  tokenId: string,
  updateData: QueryParams,
): Promise<SocketSdkResult<'postAPITokenUpdate'>>

Quota: 10 (Standard) · OpenAPI: postAPITokenUpdate · Permissions: api-tokens:create

postAPITokensRotate

Rotate an API token for an organization. Generates new token value while

async postAPITokensRotate(
  orgSlug: string,
  tokenId: string,
): Promise<SocketSdkResult<'postAPITokensRotate'>>

Quota: 10 (Standard) · OpenAPI: postAPITokensRotate · Permissions: api-tokens:rotate

postAPITokensRevoke

Revoke an API token for an organization. Permanently disables the token and

async postAPITokensRevoke(
  orgSlug: string,
  tokenId: string,
): Promise<SocketSdkResult<'postAPITokensRevoke'>>

Quota: 10 (Standard) · OpenAPI: postAPITokensRevoke · Permissions: api-tokens:revoke

Policies

Read and update license + security policy settings.

getOrgAlertPolicies

Get organization alert policies.

async getOrgAlertPolicies(
  orgSlug: string,
): ReturnType<typeof requestGetOrgAlertPolicies>

Quota: 1 (1 units) · OpenAPI: getOrgAlertPolicies · Permissions: alert-policy:list

getOrgAlertPolicy

Get organization alert policy.

async getOrgAlertPolicy(
  orgSlug: string,
  policyId: string,
): ReturnType<typeof requestGetOrgAlertPolicy>

Quota: 1 (1 units) · OpenAPI: getOrgAlertPolicy · Permissions: alert-policy:read

createOrgAlertPolicy

Create organization alert policy.

async createOrgAlertPolicy(
  orgSlug: string,
  body: CreateOrgAlertPolicyBody,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestCreateOrgAlertPolicy>

Quota: 1 (1 units) · OpenAPI: createOrgAlertPolicy · Permissions: alert-policy:create

updateOrgAlertPolicy

Update organization alert policy.

async updateOrgAlertPolicy(
  orgSlug: string,
  policyId: string,
  body: UpdateOrgAlertPolicyBody,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestUpdateOrgAlertPolicy>

Quota: 1 (1 units) · OpenAPI: updateOrgAlertPolicy · Permissions: alert-policy:update

deleteOrgAlertPolicy

Delete organization alert policy.

async deleteOrgAlertPolicy(
  orgSlug: string,
  policyId: string,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestDeleteOrgAlertPolicy>

Quota: 1 (1 units) · OpenAPI: deleteOrgAlertPolicy · Permissions: alert-policy:delete

getOrgAlertPolicyRules

Get organization alert policy rules.

async getOrgAlertPolicyRules(
  orgSlug: string,
  policyId: string,
): ReturnType<typeof requestGetOrgAlertPolicyRules>

Quota: 1 (1 units) · OpenAPI: getOrgAlertPolicyRules · Permissions: alert-policy:list

getOrgAlertPolicyRule

Get organization alert policy rule.

async getOrgAlertPolicyRule(
  orgSlug: string,
  policyId: string,
  ruleId: string,
): ReturnType<typeof requestGetOrgAlertPolicyRule>

Quota: 1 (1 units) · OpenAPI: getOrgAlertPolicyRule · Permissions: alert-policy:read

createOrgAlertPolicyRule

Create organization alert policy rule.

async createOrgAlertPolicyRule(
  orgSlug: string,
  policyId: string,
  body: CreateOrgAlertPolicyRuleBody,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestCreateOrgAlertPolicyRule>

Quota: 1 (1 units) · OpenAPI: createOrgAlertPolicyRule · Permissions: alert-policy:create

updateOrgAlertPolicyRule

Update organization alert policy rule.

async updateOrgAlertPolicyRule(
  orgSlug: string,
  policyId: string,
  ruleId: string,
  body: UpdateOrgAlertPolicyRuleBody,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestUpdateOrgAlertPolicyRule>

Quota: 1 (1 units) · OpenAPI: updateOrgAlertPolicyRule · Permissions: alert-policy:update

deleteOrgAlertPolicyRule

Delete organization alert policy rule.

async deleteOrgAlertPolicyRule(
  orgSlug: string,
  policyId: string,
  ruleId: string,
  options?: AlertPolicyWriteOptions | undefined,
): ReturnType<typeof requestDeleteOrgAlertPolicyRule>

Quota: 1 (1 units) · OpenAPI: deleteOrgAlertPolicyRule · Permissions: alert-policy:delete

getOrgAlertPolicyMigrationStatus

Get organization alert policy migration status.

async getOrgAlertPolicyMigrationStatus(
  orgSlug: string,
): ReturnType<typeof requestGetOrgAlertPolicyMigrationStatus>

Quota: 1 (1 units) · OpenAPI: getOrgAlertPolicyMigrationStatus · Permissions: alert-policy:list

translateOrgAlertPolicyMigrationTriage

Translate organization alert policy migration triage.

async translateOrgAlertPolicyMigrationTriage(
  orgSlug: string,
  body: TranslateOrgAlertPolicyMigrationTriageBody,
): ReturnType<typeof requestTranslateOrgAlertPolicyMigrationTriage>

Quota: 1 (1 units) · OpenAPI: translateOrgAlertPolicyMigrationTriage

getOrgLicensePolicy

Get organization's license policy configuration. Returns allowed,

async getOrgLicensePolicy(
  orgSlug: string,
): Promise<SocketSdkResult<'getOrgLicensePolicy'>>

Quota: 1 (1 units) · OpenAPI: getOrgLicensePolicy · Permissions: license-policy:read

updateOrgLicensePolicy

Update organization's license policy configuration. Modifies allowed,

async updateOrgLicensePolicy(
  orgSlug: string,
  policyData: QueryParams,
  queryParams?: QueryParams | undefined,
): Promise<SocketSdkResult<'updateOrgLicensePolicy'>>

Quota: 1 (1 units) · OpenAPI: updateOrgLicensePolicy · Permissions: license-policy:update

viewLicensePolicy

View an organization's computed license policy allow list (Beta). Returns

async viewLicensePolicy(
  orgSlug: string,
): Promise<SocketSdkResult<'viewLicensePolicy'>>

Quota: 1 (1 units) · OpenAPI: viewLicensePolicy · Permissions: license-policy:read

licensePolicy

Compute license policy violations for a set of packages (Beta). The

async licensePolicy(
  request: QueryParams,
): Promise<SocketSdkGenericResult<LicensePolicyViolations>>

Quota: 100 (Expensive) · OpenAPI: licensePolicy · Permissions: packages:list, license-policy:read

getOrgSecurityPolicy

Get organization's security policy configuration. Returns alert rules,

async getOrgSecurityPolicy(
  orgSlug: string,
): Promise<SocketSdkResult<'getOrgSecurityPolicy'>>

Quota: 1 (1 units) · OpenAPI: getOrgSecurityPolicy · Permissions: security-policy:read

updateOrgSecurityPolicy

Update organization's security policy configuration. Modifies alert rules,

async updateOrgSecurityPolicy(
  orgSlug: string,
  policyData: QueryParams,
): Promise<SocketSdkResult<'updateOrgSecurityPolicy'>>

Quota: 1 (1 units) · OpenAPI: updateOrgSecurityPolicy · Permissions: security-policy:update

postSettings

Update user or organization settings. Configures preferences,

async postSettings(
  selectors: Array<{ organization?: string | undefined }>,
): Promise<SocketSdkResult<'postSettings'>>

Quota: 1 (1 units) · OpenAPI: postSettings

Organization settings

Read organization settings and integration state.

getIntegrationEvents

List integration events for a specific organization integration.

async getIntegrationEvents(
  orgSlug: string,
  integrationId: string,
): Promise<SocketSdkResult<'getIntegrationEvents'>>

Quota: 1 (1 units) · OpenAPI: getIntegrationEvents · Permissions: integration:list

getSocketBasicsConfig

Get the Socket Basics configuration for an organization.

async getSocketBasicsConfig(
  orgSlug: string,
): Promise<SocketSdkResult<'getSocketBasicsConfig'>>

Quota: 1 (1 units) · OpenAPI: getSocketBasicsConfig · Permissions: socket-basics:read

Telemetry

Inspect and configure organization telemetry.

getOrgTelemetryConfig

Get organization's telemetry configuration. Returns whether telemetry is

async getOrgTelemetryConfig(
  orgSlug: string,
): Promise<SocketSdkResult<'getOrgTelemetryConfig'>>

Quota: 1 (1 units) · OpenAPI: getOrgTelemetryConfig

updateOrgTelemetryConfig

Update organization's telemetry configuration. Enables or disables

async updateOrgTelemetryConfig(
  orgSlug: string,
  telemetryData: { enabled?: boolean | undefined },
): Promise<SocketSdkResult<'updateOrgTelemetryConfig'>>

Quota: 1 (1 units) · OpenAPI: updateOrgTelemetryConfig · Permissions: telemetry-policy:update

postOrgTelemetry

Post telemetry data for an organization. Sends telemetry events and

async postOrgTelemetry(
  orgSlug: string,
  telemetryData: PostOrgTelemetryPayload,
): Promise<SocketSdkGenericResult<PostOrgTelemetryResponse>>

Quota: not tracked

Audit log

Fetch organization audit log events.

getAuditLogEvents

Retrieve audit log events for an organization. Returns chronological log of

async getAuditLogEvents(
  orgSlug: string,
  queryParams?: QueryParams | undefined,
): Promise<SocketSdkResult<'getAuditLogEvents'>>

Quota: 1 (1 units) · OpenAPI: getAuditLogEvents · Permissions: audit-log:list

Threat campaigns

Browse supply chain attack campaigns and the packages they affect.

listThreatCampaigns

List threat campaigns for an organization (v1 API, public route),

async listThreatCampaigns(
  orgSlug: string,
  options?: ListThreatCampaignsOptions | undefined,
): Promise<ListThreatCampaignsResult | StrictErrorResult>

Quota: not tracked

getThreatCampaign

Get a single threat campaign by ID (v1 API, public route). Same shape as

async getThreatCampaign(
  orgSlug: string,
  campaignId: string,
): Promise<GetThreatCampaignResult | StrictErrorResult>

Quota: not tracked

listThreatCampaignPackages

List package PURLs affected by a single threat campaign (v1 API, public

async listThreatCampaignPackages(
  orgSlug: string,
  campaignId: string,
  options?: ListThreatCampaignPackagesOptions | undefined,
): Promise<ListThreatCampaignPackagesResult | StrictErrorResult>

Quota: not tracked

Events

Ingest organization telemetry events.

postEvents

Post organization events for telemetry ingestion (v1 API, public route).

async postEvents(
  orgSlug: string,
  events: SocketEvent[],
): Promise<PostEventsResult | StrictErrorResult>

Quota: not tracked

Packages

Per-package and batch package analysis.

getScoreByNpmPackage

Get security score for a specific npm package and version. Returns

async getScoreByNpmPackage(
  pkgName: string,
  version: string,
): Promise<SocketSdkResult<'getScoreByNPMPackage'>>

Quota: 1 (1 units) · OpenAPI: getScoreByNPMPackage

getIssuesByNpmPackage

Get security issues for a specific npm package and version. Returns

async getIssuesByNpmPackage(
  pkgName: string,
  version: string,
): Promise<SocketSdkResult<'getIssuesByNPMPackage'>>

Quota: 1 (1 units) · OpenAPI: getIssuesByNPMPackage

batchPackageFetch

Fetch package analysis data for multiple packages in a single batch

async batchPackageFetch(
  componentsObj: PurlComponents,
  queryParams?: PurlQuery | undefined,
): Promise<PurlFetchResult>

Quota: 100 (Expensive) · OpenAPI: batchPackageFetch · Permissions: packages:list

batchOrgPackageFetch

Get package metadata and alerts by PURL strings for a specific

async batchOrgPackageFetch(
  orgSlug: string,
  componentsObj: PurlComponents,
  queryParams?: OrgPurlQuery | undefined,
): Promise<PurlFetchResult>

Quota: not tracked · OpenAPI: batchPackageFetchByOrg

batchOrgPackageStream

Stream organization package analysis as records arrive.

batchOrgPackageStream(
  orgSlug: string,
  componentsObj: PurlComponents,
  options?: PurlStreamOptions<OrgPurlQuery> | undefined,
): AsyncGenerator<PurlStreamResult>

Quota: 100 (Expensive) · OpenAPI: batchOrgPackageStream · Permissions: packages:list

getOrgPurlVersions

List package version history through the v1 API.

async getOrgPurlVersions(
  orgSlug: string,
  purl: string,
  options?: PurlVersionsOptions | undefined,
): ReturnType<typeof getOrgPurlVersions>

Quota: 100 (Expensive) · OpenAPI: getOrgPurlVersions · Permissions: packages:list

batchPackageStream

Stream package analysis data for multiple packages with chunked processing

batchPackageStream(
  componentsObj: PurlComponents,
  options?: BatchPackageStreamOptions | undefined,
): AsyncGenerator<PurlStreamResult>

Quota: 100 (Expensive) · OpenAPI: batchPackageStream · Permissions: packages:list

checkMalware

Check every input PURL for malware. Incomplete analysis has an explicit

async checkMalware(
  components: Array<{ purl: string }>,
): Promise<SocketSdkGenericResult<MalwareCheckEntry[]>>

Quota: not tracked

searchDependencies

Search for dependencies across monitored projects. Returns matching

async searchDependencies(
  queryParams?: QueryParams | undefined,
): Promise<SocketSdkResult<'searchDependencies'>>

Quota: 1 (1 units) · OpenAPI: searchDependencies

Dependencies and manifests

Upload manifests and snapshot dependency graphs.

uploadManifestFiles

Upload manifest files for dependency analysis. Processes package files to

async uploadManifestFiles(
  orgSlug: string,
  filepaths: string[],
  options?: UploadManifestFilesOptions | undefined,
): Promise<UploadManifestFilesReturnType | UploadManifestFilesError>

Quota: 100 (Expensive) · OpenAPI: uploadManifestFiles · Permissions: packages:upload

createDependenciesSnapshot

Create a snapshot of project dependencies by uploading manifest files.

async createDependenciesSnapshot(
  filepaths: string[],
  options?: CreateDependenciesSnapshotOptions | undefined,
): Promise<SocketSdkResult<'createDependenciesSnapshot'>>

Quota: 100 (Expensive) · OpenAPI: createDependenciesSnapshot · Permissions: report:write

getSupportedFiles

Get list of supported file types for full scan generation. Returns glob

async getSupportedFiles(
  orgSlug: string,
): Promise<SocketSdkResult<'getSupportedFiles'>>

Quota: 1 (1 units) · OpenAPI: getSupportedFiles

Exports

Export full scans in industry-standard formats.

exportCDX

Export scan results in CycloneDX SBOM format. Returns Software Bill of

async exportCDX(
  orgSlug: string,
  fullScanId: string,
): Promise<SocketSdkResult<'exportCDX'>>

Quota: 1 (1 units) · OpenAPI: exportCDX · Permissions: report:read

exportSPDX

Export scan results in SPDX SBOM format. Returns Software Bill of Materials

async exportSPDX(
  orgSlug: string,
  fullScanId: string,
): Promise<SocketSdkResult<'exportSPDX'>>

Quota: 1 (1 units) · OpenAPI: exportSPDX · Permissions: report:read

exportOpenVEX

Export vulnerability exploitability data as an OpenVEX v0.2.0 document.

async exportOpenVEX(
  orgSlug: string,
  id: string,
  options?:
    | {
        author?: string | undefined
        document_id?: string | undefined
        role?: string | undefined
      }
    | undefined,
): Promise<SocketSdkResult<'exportOpenVEX'>>

Quota: 1 (1 units) · OpenAPI: exportOpenVEX · Permissions: report:read

Quota

Inspect current API quota.

getQuota

Get current API quota usage and limits. Returns remaining requests, rate

async getQuota(): Promise<SocketSdkResult<'getQuota'>>

Quota: 0 (Free) · OpenAPI: getQuota

Metadata

Alert-type and license metadata lookups.

alertTypes

Get metadata for a set of alert types. Accepts an array of alert type

async alertTypes(
  alertTypes: string[],
  options?: { language?: string | undefined } | undefined,
): Promise<SocketSdkResult<'alertTypes'>>

Quota: 1 (1 units) · OpenAPI: alertTypes

licenseMetadata

Get metadata for a set of licenses (SPDX identifiers or expressions).

async licenseMetadata(
  request: QueryParams,
  options?: { includetext?: boolean | undefined } | undefined,
): Promise<SocketSdkResult<'licenseMetadata'>>

Quota: 1 (1 units) · OpenAPI: licenseMetadata

Meta

The Socket API OpenAPI definition.

getOpenAPI

Get the Socket API OpenAPI definition.

async getOpenAPI(): Promise<SocketSdkResult<'getOpenAPI'>>

Quota: 1 (1 units) · OpenAPI: getOpenAPI

getOpenAPIJSON

Get the Socket API OpenAPI definition as JSON.

async getOpenAPIJSON(): Promise<SocketSdkResult<'getOpenAPIJSON'>>

Quota: 1 (1 units) · OpenAPI: getOpenAPIJSON

Escape hatches

Raw HTTP access for endpoints the SDK does not wrap.

getApi

Execute a raw GET request to any API endpoint with configurable response

async getApi<T = HttpResponse>(
  urlPath: string,
  options?: GetOptions | undefined,
): Promise<T | SocketSdkGenericResult<T>>

Quota: 0 (Free) · OpenAPI: getApi

sendApi

Send POST or PUT request with JSON body and return parsed JSON response.

async sendApi<T>(
  urlPath: string,
  options?: SendOptions | undefined,
): Promise<T | SocketSdkGenericResult<T>>

Quota: 0 (Free) · OpenAPI: sendApi

Other

Methods not yet placed into a domain group. Add them to GROUPS in scripts/repo/gen-api-docs.mts.

getOrgThreatFeedItems

List threat-feed items for an organization. Returns recently observed

async getOrgThreatFeedItems(
  orgSlug: string,
  queryParams?: QueryParams | undefined,
): Promise<SocketSdkResult<'getOrgThreatFeedItems'>>

Quota: 1 (1 units) · OpenAPI: getOrgThreatFeedItems · Permissions: threat-feed:list

getThreatFeedItems

List threat-feed items across all organizations the token can see. Returns

async getThreatFeedItems(
  queryParams?: QueryParams | undefined,
): Promise<SocketSdkResult<'getThreatFeedItems'>>

Quota: 1 (1 units) · OpenAPI: getThreatFeedItems · Permissions: threat-feed:list

fetchPatchesByCVE

Search for available patches that fix a specific CVE.

async fetchPatchesByCVE(
  orgSlug: string,
  cveId: string,
): Promise<PatchSearchResponse>

Quota: 10 (Standard) · OpenAPI: fetchPatchesByCVE

fetchPatchesByGHSA

Search for available patches that fix a specific GHSA.

async fetchPatchesByGHSA(
  orgSlug: string,
  ghsaId: string,
): Promise<PatchSearchResponse>

Quota: 10 (Standard) · OpenAPI: fetchPatchesByGHSA

fetchPatchesByPackage

Search for available patches for a package specified by PURL.

async fetchPatchesByPackage(
  orgSlug: string,
  purl: string,
): Promise<PatchSearchResponse>

Quota: 10 (Standard) · OpenAPI: fetchPatchesByPackage

fetchPatchesBatch

Search for available patches for multiple packages specified by PURL.

async fetchPatchesBatch(
  orgSlug: string,
  components: Array<{ purl: string }>,
): Promise<PatchesBatchResponse>

Quota: 20 (20 units) · OpenAPI: fetchPatchesBatch

fetchPatchRecords

Fetch the metadata records of multiple patches by UUID in one request:

async fetchPatchRecords(
  orgSlug: string,
  uuids: string[],
): Promise<PatchRecordsResponse>

Quota: 10 (Standard) · OpenAPI: fetchPatchRecords

getPatchPackages

Get org-scoped download references for a batch of patches.

async getPatchPackages(
  orgSlug: string,
  uuids: string[],
  options?: { freeOnly?: boolean | undefined } | undefined,
): Promise<GetPatchPackagesResponse>

Quota: 20 (20 units) · OpenAPI: getPatchPackages

patchPackageStats

High-level statistics for a batch of patch package references granted

async patchPackageStats(
  orgSlug: string,
  references: string[],
): Promise<PatchPackageStatsResponse>

Quota: 10 (Standard) · OpenAPI: patchPackageStats

lookupPatchPackage

Look up the patch metadata behind a batch of patch package references

async lookupPatchPackage(
  orgSlug: string,
  references: string[],
): Promise<LookupPatchPackageResponse>

Quota: 10 (Standard) · OpenAPI: lookupPatchPackage

getPatchDiff

Download a compact per-file binary delta (bsdiff/BSDIFF40) archive for

async getPatchDiff(orgSlug: string, uuid: string): Promise<Uint8Array>

Quota: 10 (Standard) · OpenAPI: getPatchDiff

getPatchBlob

Download a patch blob by its SHA256 content hash. Returns the raw

async getPatchBlob(orgSlug: string, hash: string): Promise<Uint8Array>

Quota: 1 (1 units) · OpenAPI: getPatchBlob