Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

REST API endpoints for AI Scan

Use the REST API to get and update AI Scan settings for an organization.

Get the AI Scan setting for an organization

Note

This endpoint is in public preview and is subject to change.

Gets the AI Scan setting stored on an organization.

The response reports the value stored on the organization. Organization respects enterprise policy.

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:org, repo, or write:org scope to use this endpoint. Organization owners can use admin:org or repo; security managers need write:org.

"Get the AI Scan setting for an organization"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:

  • "Administration" organization permissions (read)

"Get the AI Scan setting for an organization"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
org string 필수

The organization name. The name is not case sensitive.

"Get the AI Scan setting for an organization"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

403

Forbidden

404

Resource not found

"Get the AI Scan setting for an organization"에 대한 코드 샘플

GitHub에 GHE.com으로 액세스하는 경우, api.github.comapi.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.

요청 예제

get/orgs/{org}/code-scanning/ai-scan
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/code-scanning/ai-scan

Response

Status: 200
{ "pr_scan": "enabled" }

Update the AI Scan setting for an organization

Note

This endpoint is in public preview and is subject to change.

Updates the AI Scan setting stored on an organization.

The organization respects the enterprise policy, so enabling is rejected when the enterprise disallows AI Scan.

OAuth app tokens and personal access tokens (classic) need the admin:org, repo, or write:org scope to use this endpoint. Organization owners can use admin:org or repo; security managers need write:org.

"Update the AI Scan setting for an organization"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:

  • "Administration" organization permissions (write)

"Update the AI Scan setting for an organization"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
org string 필수

The organization name. The name is not case sensitive.

본문 매개 변수
이름, 유형, 설명
pr_scan string

Whether 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.

다음 중 하나일 수 있습니다.: enabled, disabled

"Update the AI Scan setting for an organization"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

"Update the AI Scan setting for an organization"에 대한 코드 샘플

GitHub에 GHE.com으로 액세스하는 경우, api.github.comapi.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.

요청 예제

patch/orgs/{org}/code-scanning/ai-scan
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/code-scanning/ai-scan \ -d '{"pr_scan":"enabled"}'

Response

Status: 200
{ "pr_scan": "enabled" }