alert-policies

Get Org Alert Policy

Changed on

Fetch a single alert policy by ID. Use default as the ID for the default policy, which applies to all repositories without a policy label. Requires a token with org-wide repository access; repo-restricted tokens receive 403.

This endpoint consumes 1 unit of your quota.

This endpoint requires the following org token scopes:

  • alert-policy:read
get/orgs/{org_slug}/alert-policies/{policy_id}

Request

  • Base URL
    https://api.socket.dev/v0
  • URL
    https://api.socket.dev/v0/orgs/{org_slug}/alert-policies/{policy_id}
  • Auth
    • HTTP bearer
    • or HTTP basic

Path parameters

org_slugstring required

The slug of the organization

policy_idstring required

The ID of the alert policy: a UUID, or default for the default policy

Response

The requested alert policy.

idstring required

The ID of the policy: a UUID, or default for the default policy until it is first customized.

namestring nullable required

The policy name. Null for the default policy, which applies to all repositories without a policy label.

descriptionstring nullable required

Operator-provided description.

apply_method'labeled_repos' | 'unlabeled_repos' required

How the policy scopes to repositories: labeled_repos applies to repositories carrying the policy repo label; unlabeled_repos is the default policy for all unlabeled repositories.

repo_label_idstring nullable required

The repo label that scopes this policy. Null for the default policy.

repository_idsstring[] required

Repositories the policy scopes to. Empty for the default policy and for policies with no repository assignments.

baselinestring nullable required

Baseline rule bundle the policy starts from. One of: essential, balanced, comprehensive. Null when the policy has no baseline.

created_bystring nullable required

User ID that created the policy.

updated_bystring nullable required

User ID that last updated the policy.

created_atstring nullable required

ISO-8601 creation timestamp. Null for the default policy until it is first customized.

updated_atstring nullable required

ISO-8601 last-update timestamp. Null for the default policy until it is first customized.

Changes