Skip to content

GitHub: Create a repository security advisory

GitHub securityAdvisories.securityAdvisoriesCreateRepositoryAdvisory: arguments, response, policy and SDK examples.

← Security advisories operations · Get started

Operation github.security_advisories_create_repository_advisory

Provider route: POST /repos/{owner}/{repo}/security-advisories. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["securityAdvisories"]["securityAdvisoriesCreateRepositoryAdvisory"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.securityAdvisories.securityAdvisoriesCreateRepositoryAdvisory(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.security_advisories.security_advisories_create_repository_advisory(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.ownerstringRequired within parent
path.repostringRequired within parent
bodyModelRequired within parentExpand Create a repository security advisory — request body — body

Referenced models: Create a repository security advisory — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a repository security advisory — response body

Referenced models: Get a repository security advisory — response body

8 more schemas are linked from the tables above, on the schema pages.

Get a repository security advisory — response body
FieldTypePresenceDescription and constraints
$objectRootA repository security advisory.
Additional keys: not allowed
authorJSONRequired within parent
author (anyOf 1)JSONAlternativeThe author of the advisory.
Read only: true
author (anyOf 1) (allOf 1)ModelAll variants applyExpand List users — response body — item
author (anyOf 2)nullAlternative
closed_atJSONRequired within parent
closed_at (anyOf 1)stringAlternativeThe date and time of when the advisory was closed, in ISO 8601 format.
Format: date-time
Read only: true
closed_at (anyOf 2)nullAlternative
collaborating_teamsJSONRequired within parent
collaborating_teams (anyOf 1)arrayAlternativeA list of teams that collaborate on the advisory.
collaborating_teams (anyOf 1)[]ModelEach itemExpand List teams — response body — item
collaborating_teams (anyOf 2)nullAlternative
collaborating_usersJSONRequired within parent
collaborating_users (anyOf 1)arrayAlternativeA list of users that collaborate on the advisory.
collaborating_users (anyOf 1)[]ModelEach itemExpand List users — response body — item
collaborating_users (anyOf 2)nullAlternative
created_atJSONRequired within parent
created_at (anyOf 1)stringAlternativeThe date and time of when the advisory was created, in ISO 8601 format.
Format: date-time
Read only: true
created_at (anyOf 2)nullAlternative
creditsJSONRequired within parent
credits (anyOf 1)arrayAlternative
credits (anyOf 1)[]objectEach item
credits (anyOf 1)[].loginstringOptionalThe username of the user credited.
credits (anyOf 1)[].typestringOptionalThe type of credit the user is receiving.
Known values: analyst, finder, reporter, coordinator, remediation_developer, remediation_reviewer, remediation_verifier, tool, sponsor, other
credits (anyOf 2)nullAlternative
credits_detailedJSONRequired within parent
credits_detailed (anyOf 1)arrayAlternativeRead only: true
credits_detailed (anyOf 1)[]ModelEach itemExpand Get a repository security advisory — response body — credits detailed array item
credits_detailed (anyOf 2)nullAlternative
cve_idJSONRequired within parent
cve_id (anyOf 1)stringAlternativeThe Common Vulnerabilities and Exposures (CVE) ID.
cve_id (anyOf 2)nullAlternative
cvss_severitiesModelOptionalExpand Get a global security advisory — response body — cvss severities
cwe_idsJSONRequired within parent
cwe_ids (anyOf 1)arrayAlternativeA list of only the CWE IDs.
cwe_ids (anyOf 1)[]stringEach item
cwe_ids (anyOf 2)nullAlternative
cwesJSONRequired within parent
cwes (anyOf 1)arrayAlternativeRead only: true
cwes (anyOf 1)[]objectEach item
cwes (anyOf 1)[].cwe_idstringRequired within parentThe Common Weakness Enumeration (CWE) identifier.
cwes (anyOf 1)[].namestringRequired within parentThe name of the CWE.
Read only: true
cwes (anyOf 2)nullAlternative
descriptionJSONRequired within parent
description (anyOf 1)stringAlternativeA detailed description of what the advisory entails.
Maximum length: 65535
description (anyOf 2)nullAlternative
ghsa_idstringRequired within parentThe GitHub Security Advisory ID.
Read only: true
html_urlstringRequired within parentThe URL for the advisory.
Format: uri
Read only: true
identifiersarrayRequired within parentRead only: true
identifiers[]objectEach item
identifiers[].typestringRequired within parentThe type of identifier.
Known values: CVE, GHSA
identifiers[].valuestringRequired within parentThe identifier value.
private_forkJSONRequired within parent
private_fork (anyOf 1)JSONAlternativeA temporary private fork of the advisory's repository for collaborating on a fix.
Read only: true
private_fork (anyOf 1) (allOf 1)ModelAll variants applyExpand List repositories for a user migration — response body — item
private_fork (anyOf 2)nullAlternative
published_atJSONRequired within parent
published_at (anyOf 1)stringAlternativeThe date and time of when the advisory was published, in ISO 8601 format.
Format: date-time
Read only: true
published_at (anyOf 2)nullAlternative
publisherJSONRequired within parent
publisher (anyOf 1)JSONAlternativeThe publisher of the advisory.
Read only: true
publisher (anyOf 1) (allOf 1)ModelAll variants applyExpand List users — response body — item
publisher (anyOf 2)nullAlternative
severityJSONRequired within parent
severity (anyOf 1)stringAlternativeThe severity of the advisory.
Known values: critical, high, medium, low
severity (anyOf 2)nullAlternative
statestringRequired within parentThe state of the advisory.
Known values: published, closed, withdrawn, draft, triage
submissionJSONRequired within parent
submission (anyOf 1)objectAlternativeRead only: true
submission (anyOf 1).acceptedbooleanRequired within parentWhether a private vulnerability report was accepted by the repository's administrators.
Read only: true
submission (anyOf 2)nullAlternative
summarystringRequired within parentA short summary of the advisory.
Maximum length: 1024
updated_atJSONRequired within parent
updated_at (anyOf 1)stringAlternativeThe date and time of when the advisory was last updated, in ISO 8601 format.
Format: date-time
Read only: true
updated_at (anyOf 2)nullAlternative
urlstringRequired within parentThe API URL for the advisory.
Format: uri
Read only: true
vulnerabilitiesJSONRequired within parent
vulnerabilities (anyOf 1)arrayAlternative
vulnerabilities (anyOf 1)[]ModelEach itemExpand Get a repository security advisory — response body — vulnerabilities array item
vulnerabilities (anyOf 2)nullAlternative
withdrawn_atJSONRequired within parent
withdrawn_at (anyOf 1)stringAlternativeThe date and time of when the advisory was withdrawn, in ISO 8601 format.
Format: date-time
Read only: true
withdrawn_at (anyOf 2)nullAlternative

Referenced models: Get a global security advisory — response body — cvss severities, Get a repository security advisory — response body — credits detailed array item, Get a repository security advisory — response body — vulnerabilities array item, List repositories for a user migration — response body — item, List users — response body — item, List teams — response body — item

Get a repository security advisory — response body — credits detailed array item
FieldTypePresenceDescription and constraints
$objectRootA credit given to a user for a repository security advisory.
Additional keys: not allowed
statestringRequired within parentThe state of the user's acceptance of the credit.
Known values: accepted, declined, pending
typestringRequired within parentThe type of credit the user is receiving.
Known values: analyst, finder, reporter, coordinator, remediation_developer, remediation_reviewer, remediation_verifier, tool, sponsor, other
userModelRequired within parentExpand List users — response body — item

Referenced models: List users — response body — item

Get a global security advisory — response body — vulnerabilities array item package ecosystem, name
FieldTypePresenceDescription and constraints
$objectRootThe name of the package affected by the vulnerability.
ecosystemstringRequired within parentThe package's language or package management ecosystem.
Known values: rubygems, npm, pip, maven, nuget, composer, go, rust, erlang, actions, pub, other, swift
nameJSONRequired within parent
name (anyOf 1)stringAlternativeThe unique package name within its ecosystem.
name (anyOf 2)nullAlternative
Create a team — response body — parent
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Create a team — response body — parent / type: enterprise, organization
$ (anyOf 2)nullAlternative

Referenced models: Create a team — response body — parent / type: enterprise, organization

SDK function policy ID: github.security_advisories_create_repository_advisory. Catalog operation: security-advisories/create-repository-advisory. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.