Skip to content

GitHub: Code scanning schemas

36 GitHub schemas with complete fields and constraints.

← Code scanning operations · All schemas

Commit an autofix for a code scanning alert — request body — body

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternativeCommit an autofix for a code scanning alert
$ (anyOf 1).messagestringOptionalCommit message to be used.
$ (anyOf 1).target_refstringOptionalThe Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation.
$ (anyOf 2)nullAlternative

Commit an autofix for a code scanning alert — response body

FieldTypePresenceDescription and constraints
$objectRoot
shastringOptionalSHA of commit with autofix.
target_refstringOptionalThe Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation.

Create a Code QL variant analysis — response body

FieldTypePresenceDescription and constraints
$objectRootA run of a CodeQL query against one or more repositories.
actions_workflow_run_idJSONOptional
actions_workflow_run_id (anyOf 1)integerAlternativeThe GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started.
actions_workflow_run_id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
actorModelRequired within parentExpand List users — response body — item
completed_atJSONOptional
completed_at (anyOf 1)stringAlternativeThe date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available.
Format: date-time
completed_at (anyOf 2)nullAlternative
controller_repoModelRequired within parentExpand List repositories for a user migration — response body — item
created_atstringOptionalThe date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
failure_reasonstringOptionalThe reason for a failure of the variant analysis. This is only available if the variant analysis has failed.
Known values: no_repos_queried, actions_workflow_run_failed, internal_error
idJSONRequired within parent
id (anyOf 1)integerAlternativeThe ID of the variant analysis.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
query_languagestringRequired within parentThe language targeted by the CodeQL query
Known values: actions, cpp, csharp, go, java, javascript, python, ruby, rust, swift
query_pack_urlstringRequired within parentThe download url for the query pack.
scanned_repositoriesarrayOptional
scanned_repositories[]objectEach item
scanned_repositories[].analysis_statusstringRequired within parentThe new status of the CodeQL variant analysis repository task.
Known values: pending, in_progress, succeeded, failed, canceled, timed_out
scanned_repositories[].artifact_size_in_bytesJSONOptional
scanned_repositories[].artifact_size_in_bytes (anyOf 1)integerAlternativeThe size of the artifact. This is only available for successful analyses.
scanned_repositories[].artifact_size_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
scanned_repositories[].failure_messagestringOptionalThe reason of the failure of this repo task. This is only available if the repository task has failed.
scanned_repositories[].repositoryModelRequired within parentExpand Create a Code QL variant analysis — response body — scanned repositories item repository
scanned_repositories[].result_countJSONOptional
scanned_repositories[].result_count (anyOf 1)integerAlternativeThe number of results in the case of a successful analysis. This is only available for successful analyses.
scanned_repositories[].result_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
skipped_repositoriesobjectOptionalInformation about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis.
skipped_repositories.access_mismatch_reposModelRequired within parentExpand Create a Code QL variant analysis — response body — skipped repositories over limit repos
skipped_repositories.no_codeql_db_reposModelRequired within parentExpand Create a Code QL variant analysis — response body — skipped repositories over limit repos
skipped_repositories.not_found_reposobjectRequired within parent
skipped_repositories.not_found_repos.repository_countJSONRequired within parent
skipped_repositories.not_found_repos.repository_count (anyOf 1)integerAlternativeThe total number of repositories that were skipped for this reason.
skipped_repositories.not_found_repos.repository_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
skipped_repositories.not_found_repos.repository_full_namesarrayRequired within parentA list of full repository names that were skipped. This list may not include all repositories that were skipped.
skipped_repositories.not_found_repos.repository_full_names[]stringEach item
skipped_repositories.over_limit_reposModelRequired within parentExpand Create a Code QL variant analysis — response body — skipped repositories over limit repos
statusstringRequired within parentKnown values: in_progress, succeeded, failed, cancelled
updated_atstringOptionalThe date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time

Referenced models: Create a Code QL variant analysis — response body — scanned repositories item repository, Create a Code QL variant analysis — response body — skipped repositories over limit repos, List repositories for a user migration — response body — item, List users — response body — item

Create a Code QL variant analysis — response body — scanned repositories item repository

FieldTypePresenceDescription and constraints
$objectRootRepository Identifier
full_namestringRequired within parentThe full, globally unique, name of the repository.
idJSONRequired within parent
id (anyOf 1)integerAlternativeA unique identifier of the repository.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringRequired within parentThe name of the repository.
privatebooleanRequired within parentWhether the repository is private.
stargazers_countJSONRequired within parent
stargazers_count (anyOf 1)integerAlternative
stargazers_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
updated_atJSONRequired within parent
updated_at (anyOf 1)stringAlternativeFormat: date-time
updated_at (anyOf 2)nullAlternative

Create a Code QL variant analysis — response body — skipped repositories over limit repos

FieldTypePresenceDescription and constraints
$objectRoot
repositoriesarrayRequired within parentA list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it.
repositories[]ModelEach itemExpand Create a Code QL variant analysis — response body — scanned repositories item repository
repository_countJSONRequired within parent
repository_count (anyOf 1)integerAlternativeThe total number of repositories that were skipped for this reason.
repository_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Create a Code QL variant analysis — response body — scanned repositories item repository

Delete a code scanning analysis from a repository — response body

FieldTypePresenceDescription and constraints
$objectRootSuccessful deletion of a code scanning analysis
confirm_delete_urlJSONRequired within parent
confirm_delete_url (anyOf 1)stringAlternativeNext deletable analysis in chain, with last analysis deletion confirmation
Format: uri
Read only: true
confirm_delete_url (anyOf 2)nullAlternative
next_analysis_urlJSONRequired within parent
next_analysis_url (anyOf 1)stringAlternativeNext deletable analysis in chain, without last analysis deletion confirmation
Format: uri
Read only: true
next_analysis_url (anyOf 2)nullAlternative

Get AI Scan enablement for a repository — response body

FieldTypePresenceDescription and constraints
$objectRootAI Scan enablement for a repository.
pr_scanstringRequired within parentWhether AI Scan is enabled for the repository.
Known values: enabled, disabled

Get a Code QL database for a repository — response body

FieldTypePresenceDescription and constraints
$objectRootA CodeQL database.
commit_oidJSONOptional
commit_oid (anyOf 1)stringAlternativeThe commit SHA of the repository at the time the CodeQL database was created.
commit_oid (anyOf 2)nullAlternative
content_typestringRequired within parentThe MIME type of the CodeQL database file.
created_atstringRequired within parentThe date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
idJSONRequired within parent
id (anyOf 1)integerAlternativeThe ID of the CodeQL database.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
languagestringRequired within parentThe language of the CodeQL database.
namestringRequired within parentThe name of the CodeQL database.
sizeJSONRequired within parent
size (anyOf 1)integerAlternativeThe size of the CodeQL database file in bytes.
size (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
updated_atstringRequired within parentThe date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
uploaderModelRequired within parentExpand List users — response body — item
urlstringRequired within parentThe URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property.
Format: uri

Referenced models: List users — response body — item

Get a code scanning alert — response body

FieldTypePresenceDescription and constraints
$objectRoot
assigneesarrayOptional
assignees[]ModelEach itemExpand List users — response body — item
created_atstringRequired within parentThe time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
dismissal_approved_byModelOptionalExpand Get an issue — response body — user
dismissed_atModelRequired within parentExpand Get a Dependabot alert — response body — dismissed at
dismissed_byModelRequired within parentExpand Get an issue — response body — user
dismissed_commentModelOptionalExpand Get a code scanning alert — response body — dismissed comment
dismissed_reasonModelRequired within parentExpand Get a code scanning alert — response body — dismissed reason
fixed_atModelOptionalExpand Get a Dependabot alert — response body — fixed at
html_urlstringRequired within parentThe GitHub URL of the alert resource.
Format: uri
Read only: true
instances_urlstringRequired within parentThe REST API URL for fetching the list of instances for an alert.
Format: uri
Read only: true
linked_pull_requestsarrayOptionalPull requests linked to this alert.
linked_pull_requests[]ModelEach itemExpand Request reviewers for a pull request — response body
most_recent_instanceModelRequired within parentExpand Get a code scanning alert — response body — most recent instance
numberModelRequired within parentExpand Get a Dependabot alert — response body — number
ruleModelRequired within parentExpand Get a code scanning alert — response body — rule
stateModelRequired within parentExpand Get a code scanning alert — response body — state
toolModelRequired within parentExpand Get a code scanning alert — response body — tool
updated_atstringOptionalThe time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
urlstringRequired within parentThe REST API URL of the alert resource.
Format: uri
Read only: true

Referenced models: Get a Dependabot alert — response body — dismissed at, Get a Dependabot alert — response body — fixed at, Get a Dependabot alert — response body — number, Get a code scanning alert — response body — dismissed comment, Get a code scanning alert — response body — dismissed reason, Get a code scanning alert — response body — most recent instance, Get a code scanning alert — response body — rule, Get a code scanning alert — response body — state, Get a code scanning alert — response body — tool, Get an issue — response body — user, Request reviewers for a pull request — response body, List users — response body — item

Get a code scanning alert — response body — dismissed comment

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeThe dismissal comment associated with the dismissal of the alert.
Maximum length: 280
$ (anyOf 2)nullAlternative

Get a code scanning alert — response body — dismissed reason

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternative**Required when the state is dismissed.** The reason for dismissing or closing the alert.
Known values: false positive, won't fix, used in tests, mitigated
$ (anyOf 2)nullAlternative

Get a code scanning alert — response body — most recent instance

FieldTypePresenceDescription and constraints
$objectRoot
analysis_keystringOptionalIdentifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.
categorystringOptionalIdentifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.
classificationsarrayOptionalClassifications that have been applied to the file that triggered the alert.
For example identifying it as documentation, or a generated file.
classifications[]ModelEach itemExpand List instances of a code scanning alert — response body — item classifications item
commit_shastringOptional
environmentstringOptionalIdentifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed.
html_urlstringOptional
locationModelOptionalExpand List instances of a code scanning alert — response body — item location
messageobjectOptional
message.markdownstringOptionalThe message text as GitHub-flavored Markdown, with placeholder links for related locations replaced by links to the relevant code. Only populated when related locations are available for the alert instance.
message.textstringOptional
refstringOptionalThe Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,
`refs/heads/<branch name>` or simply `<branch name>`.
stateModelOptionalExpand Get a code scanning alert — response body — state

Referenced models: List instances of a code scanning alert — response body — item classifications item, List instances of a code scanning alert — response body — item location, Get a code scanning alert — response body — state

Get a code scanning alert — response body — rule

FieldTypePresenceDescription and constraints
$objectRoot
descriptionstringOptionalA short description of the rule used to detect the alert.
full_descriptionstringOptionalA description of the rule used to detect the alert.
helpJSONOptional
help (anyOf 1)stringAlternativeDetailed documentation for the rule as GitHub Flavored Markdown.
help (anyOf 2)nullAlternative
help_uriJSONOptional
help_uri (anyOf 1)stringAlternativeA link to the documentation for the rule used to detect the alert.
help_uri (anyOf 2)nullAlternative
idJSONOptional
id (anyOf 1)stringAlternativeA unique identifier for the rule used to detect the alert.
id (anyOf 2)nullAlternative
namestringOptionalThe name of the rule used to detect the alert.
security_severity_levelJSONOptional
security_severity_level (anyOf 1)stringAlternativeThe security severity of the alert.
Known values: low, medium, high, critical
security_severity_level (anyOf 2)nullAlternative
severityJSONOptional
severity (anyOf 1)stringAlternativeThe severity of the alert.
Known values: none, note, warning, error
severity (anyOf 2)nullAlternative
tagsJSONOptional
tags (anyOf 1)arrayAlternativeA set of tags applicable for the rule.
tags (anyOf 1)[]stringEach item
tags (anyOf 2)nullAlternative

Get a code scanning alert — response body — state

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeState of a code scanning alert.
Known values: open, dismissed, fixed
$ (anyOf 2)nullAlternative

Get a code scanning alert — response body — tool

FieldTypePresenceDescription and constraints
$objectRoot
guidModelOptionalExpand Get a code scanning alert — response body — tool guid
namestringOptionalThe name of the tool used to generate the code scanning analysis.
versionModelOptionalExpand Get a code scanning alert — response body — tool version

Referenced models: Get a code scanning alert — response body — tool guid, Get a code scanning alert — response body — tool version

Get a code scanning alert — response body — tool guid

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeThe GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data.
$ (anyOf 2)nullAlternative

Get a code scanning alert — response body — tool version

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeThe version of the tool used to generate the code scanning analysis.
$ (anyOf 2)nullAlternative

Get a code scanning analysis for a repository — response body

FieldTypePresenceDescription and constraints
$objectRoot
analysis_keystringRequired within parentIdentifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.
categorystringOptionalIdentifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.
commit_shastringRequired within parentThe SHA of the commit to which the analysis you are uploading relates.
Maximum length: 64
Minimum length: 40
Pattern: ^([0-9a-fA-F]{40}(?:[0-9a-fA-F]{24})?)$
created_atstringRequired within parentThe time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
deletablebooleanRequired within parent
environmentstringRequired within parentIdentifies the variable values associated with the environment in which this analysis was performed.
errorstringRequired within parent
idJSONRequired within parent
id (anyOf 1)integerAlternativeUnique identifier for this analysis.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
refstringRequired within parentThe Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,
`refs/heads/<branch name>` or simply `<branch name>`.
results_countJSONRequired within parent
results_count (anyOf 1)integerAlternativeThe total number of results in the analysis.
results_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
rules_countJSONRequired within parent
rules_count (anyOf 1)integerAlternativeThe total number of rules used in the analysis.
rules_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
sarif_idstringRequired within parentAn identifier for the upload.
toolModelRequired within parentExpand Get a code scanning alert — response body — tool
urlstringRequired within parentThe REST API URL of the analysis resource.
Format: uri
Read only: true
warningstringRequired within parentWarning generated when processing the analysis

Referenced models: Get a code scanning alert — response body — tool

Get a code scanning default setup configuration — response body

FieldTypePresenceDescription and constraints
$objectRootConfiguration for code scanning default setup.
languagesarrayOptionalLanguages to be analyzed.
languages[]stringEach itemKnown values: actions, c-cpp, csharp, go, java-kotlin, javascript-typescript, python, ruby, swift
query_suitestringOptionalCodeQL query suite to be used.
Known values: default, extended
runner_labelJSONOptional
runner_label (anyOf 1)stringAlternativeRunner label to be used if the runner type is labeled.
runner_label (anyOf 2)nullAlternative
runner_typeJSONOptional
runner_type (anyOf 1)stringAlternativeRunner type to be used.
Known values: standard, labeled
runner_type (anyOf 2)nullAlternative
scheduleJSONOptional
schedule (anyOf 1)stringAlternativeThe frequency of the periodic analysis.
Known values: weekly
schedule (anyOf 2)nullAlternative
statestringOptionalCode scanning default setup has been configured or not.
Known values: configured, not-configured
threat_modelstringOptionalThreat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input.
Known values: remote, remote_and_local
updated_atJSONOptional
updated_at (anyOf 1)stringAlternativeTimestamp of latest configuration update.
Format: date-time
updated_at (anyOf 2)nullAlternative

Get information about a SARIF upload — response body

FieldTypePresenceDescription and constraints
$objectRoot
analyses_urlJSONOptional
analyses_url (anyOf 1)stringAlternativeThe REST API URL for getting the analyses associated with the upload.
Format: uri
Read only: true
analyses_url (anyOf 2)nullAlternative
errorsJSONOptional
errors (anyOf 1)arrayAlternativeAny errors that ocurred during processing of the delivery.
Read only: true
errors (anyOf 1)[]stringEach item
errors (anyOf 2)nullAlternative
processing_statusstringOptional`pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed.
Known values: pending, complete, failed

Get the AI Scan setting for an organization — response body

FieldTypePresenceDescription and constraints
$objectRootThe AI Scan organization setting
pr_scanstringRequired within parentWhether AI Scan on pull requests is enabled for the organization. The organization setting respects enterprise policy, and repositories inherit it: when disabled, repositories cannot enable AI Scan; when enabled, repositories can still opt out.
Known values: enabled, disabled

Get the analysis status of a repository in a Code QL variant analysis — response body

FieldTypePresenceDescription and constraints
$objectRoot
analysis_statusstringRequired within parentThe new status of the CodeQL variant analysis repository task.
Known values: pending, in_progress, succeeded, failed, canceled, timed_out
artifact_size_in_bytesJSONOptional
artifact_size_in_bytes (anyOf 1)integerAlternativeThe size of the artifact. This is only available for successful analyses.
artifact_size_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
artifact_urlstringOptionalThe URL of the artifact. This is only available for successful analyses.
database_commit_shastringOptionalThe SHA of the commit the CodeQL database was built against. This is only available for successful analyses.
failure_messagestringOptionalThe reason of the failure of this repo task. This is only available if the repository task has failed.
repositoryModelRequired within parentExpand List repositories for a user migration — response body — item
result_countJSONOptional
result_count (anyOf 1)integerAlternativeThe number of results in the case of a successful analysis. This is only available for successful analyses.
result_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
source_location_prefixstringOptionalThe source location prefix to use. This is only available for successful analyses.

Referenced models: List repositories for a user migration — response body — item

Get the status of an autofix for a code scanning alert — response body

FieldTypePresenceDescription and constraints
$objectRoot
descriptionModelRequired within parentExpand Get the status of an autofix for a code scanning alert — response body — description
started_atstringRequired within parentThe start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
statusstringRequired within parentThe status of an autofix.
Known values: pending, error, success, outdated

Referenced models: Get the status of an autofix for a code scanning alert — response body — description

Get the status of an autofix for a code scanning alert — response body — description

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeThe description of an autofix.
$ (anyOf 2)nullAlternative

List code scanning alerts for a repository — response body — item

FieldTypePresenceDescription and constraints
$objectRoot
assigneesarrayOptional
assignees[]ModelEach itemExpand List users — response body — item
created_atstringRequired within parentThe time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
dismissal_approved_byModelOptionalExpand Get an issue — response body — user
dismissed_atModelRequired within parentExpand Get a Dependabot alert — response body — dismissed at
dismissed_byModelRequired within parentExpand Get an issue — response body — user
dismissed_commentModelOptionalExpand Get a code scanning alert — response body — dismissed comment
dismissed_reasonModelRequired within parentExpand Get a code scanning alert — response body — dismissed reason
fixed_atModelOptionalExpand Get a Dependabot alert — response body — fixed at
html_urlstringRequired within parentThe GitHub URL of the alert resource.
Format: uri
Read only: true
instances_urlstringRequired within parentThe REST API URL for fetching the list of instances for an alert.
Format: uri
Read only: true
most_recent_instanceModelRequired within parentExpand Get a code scanning alert — response body — most recent instance
numberModelRequired within parentExpand Get a Dependabot alert — response body — number
ruleModelRequired within parentExpand Get a code scanning alert — response body — rule
stateModelRequired within parentExpand Get a code scanning alert — response body — state
toolModelRequired within parentExpand Get a code scanning alert — response body — tool
updated_atstringOptionalThe time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
urlstringRequired within parentThe REST API URL of the alert resource.
Format: uri
Read only: true

Referenced models: Get a Dependabot alert — response body — dismissed at, Get a Dependabot alert — response body — fixed at, Get a Dependabot alert — response body — number, Get a code scanning alert — response body — dismissed comment, Get a code scanning alert — response body — dismissed reason, Get a code scanning alert — response body — most recent instance, Get a code scanning alert — response body — rule, Get a code scanning alert — response body — state, Get a code scanning alert — response body — tool, Get an issue — response body — user, List users — response body — item

List code scanning alerts for an organization — response body — item

FieldTypePresenceDescription and constraints
$objectRoot
assigneesarrayOptional
assignees[]ModelEach itemExpand List users — response body — item
created_atstringRequired within parentThe time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
dismissal_approved_byModelOptionalExpand Get an issue — response body — user
dismissed_atModelRequired within parentExpand Get a Dependabot alert — response body — dismissed at
dismissed_byModelRequired within parentExpand Get an issue — response body — user
dismissed_commentModelOptionalExpand Get a code scanning alert — response body — dismissed comment
dismissed_reasonModelRequired within parentExpand Get a code scanning alert — response body — dismissed reason
fixed_atModelOptionalExpand Get a Dependabot alert — response body — fixed at
html_urlstringRequired within parentThe GitHub URL of the alert resource.
Format: uri
Read only: true
instances_urlstringRequired within parentThe REST API URL for fetching the list of instances for an alert.
Format: uri
Read only: true
most_recent_instanceModelRequired within parentExpand Get a code scanning alert — response body — most recent instance
numberModelRequired within parentExpand Get a Dependabot alert — response body — number
repositoryModelRequired within parentExpand List repositories for a user migration — response body — item
ruleModelRequired within parentExpand Get a code scanning alert — response body — rule
stateModelRequired within parentExpand Get a code scanning alert — response body — state
toolModelRequired within parentExpand Get a code scanning alert — response body — tool
updated_atstringOptionalThe time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
urlstringRequired within parentThe REST API URL of the alert resource.
Format: uri
Read only: true

Referenced models: Get a Dependabot alert — response body — dismissed at, Get a Dependabot alert — response body — fixed at, Get a Dependabot alert — response body — number, Get a code scanning alert — response body — dismissed comment, Get a code scanning alert — response body — dismissed reason, Get a code scanning alert — response body — most recent instance, Get a code scanning alert — response body — rule, Get a code scanning alert — response body — state, Get a code scanning alert — response body — tool, Get an issue — response body — user, List repositories for a user migration — response body — item, List users — response body — item

List instances of a code scanning alert — response body — item

FieldTypePresenceDescription and constraints
$objectRoot
analysis_keystringOptionalIdentifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.
categorystringOptionalIdentifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.
classificationsarrayOptionalClassifications that have been applied to the file that triggered the alert.
For example identifying it as documentation, or a generated file.
classifications[]ModelEach itemExpand List instances of a code scanning alert — response body — item classifications item
commit_shastringOptional
environmentstringOptionalIdentifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed.
html_urlstringOptional
locationModelOptionalExpand List instances of a code scanning alert — response body — item location
messageobjectOptional
message.textstringOptional
refstringOptionalThe Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,
`refs/heads/<branch name>` or simply `<branch name>`.
stateModelOptionalExpand List instances of a code scanning alert — response body — item state

Referenced models: List instances of a code scanning alert — response body — item classifications item, List instances of a code scanning alert — response body — item state, List instances of a code scanning alert — response body — item location

List instances of a code scanning alert — response body — item classifications item

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeA classification of the file. For example to identify it as generated.
Known values: source, generated, test, library
$ (anyOf 2)nullAlternative

List instances of a code scanning alert — response body — item location

FieldTypePresenceDescription and constraints
$objectRootDescribe a region within a file for the alert.
end_columnJSONOptional
end_column (anyOf 1)integerAlternative
end_column (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
end_lineJSONOptional
end_line (anyOf 1)integerAlternative
end_line (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pathstringOptional
start_columnJSONOptional
start_column (anyOf 1)integerAlternative
start_column (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
start_lineJSONOptional
start_line (anyOf 1)integerAlternative
start_line (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

List instances of a code scanning alert — response body — item state

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeState of a code scanning alert instance.
Known values: open, fixed
$ (anyOf 2)nullAlternative

Update AI Scan enablement for a repository — request body — body

FieldTypePresenceDescription and constraints
$objectRootAI Scan enablement update for a repository.
Minimum fields: 1
Additional keys: not allowed
pr_scanstringOptionalWhether to enable or disable AI Scan for the repository.
One of: enabled, disabled

Update a code scanning alert — request body — body assignees

FieldTypePresenceDescription and constraints
$arrayRootThe list of users to assign to the code scanning alert. An empty array unassigns all previous assignees from the alert.
$[]stringEach item

Update a code scanning alert — request body — body dismissed reason

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternative**Required when the state is dismissed.** The reason for dismissing or closing the alert.
One of: false positive, won't fix, used in tests, mitigated
$ (anyOf 2)nullAlternative

Update a code scanning default setup configuration — request body — body

FieldTypePresenceDescription and constraints
$objectRootConfiguration for code scanning default setup.
Additional keys: not allowed
languagesarrayOptionalCodeQL languages to be analyzed.
languages[]stringEach itemOne of: actions, c-cpp, csharp, go, java-kotlin, javascript-typescript, python, ruby, swift
query_suitestringOptionalCodeQL query suite to be used.
One of: default, extended
runner_labelJSONOptional
runner_label (anyOf 1)stringAlternativeRunner label to be used if the runner type is labeled.
runner_label (anyOf 2)nullAlternative
runner_typestringOptionalRunner type to be used.
One of: standard, labeled
statestringOptionalThe desired state of code scanning default setup.
One of: configured, not-configured
threat_modelstringOptionalThreat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input.
One of: remote, remote_and_local

Update the AI Scan setting for an organization — request body — body

FieldTypePresenceDescription and constraints
$objectRootThe AI Scan organization setting to apply
Minimum fields: 1
Additional keys: not allowed
pr_scanstringOptionalWhether AI Scan is enabled for the organization. Organization respects enterprise policy. Disabled organizations prevent repositories from enabling AI Scan. Enabled organizations enable AI Scan for their repositories, but individual repositories can opt out.
One of: enabled, disabled

Upload an analysis as SARIF data — response body

FieldTypePresenceDescription and constraints
$objectRoot
idstringOptionalAn identifier for the upload.
urlstringOptionalThe REST API URL for checking the status of the upload.
Format: uri
Read only: true

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.