Use the REST API to manage fine-grained personal access tokens.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /orgs/{org}/personal-access-token-requests
Lists requests from organization members to access organization resources with a fine-grained personal access token.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
sort (string)
The property by which to sort the results.
Default: created_at
Can be one of: created_at
direction (string)
The direction to sort the results by.
Default: desc
Can be one of: asc, desc
owner (array)
A list of owner usernames to use to filter the results.
repository (string)
The name of the repository to use to filter the results.
permission (string)
The permission to use to filter the results.
last_used_before (string)
Only show fine-grained personal access tokens used before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
last_used_after (string)
Only show fine-grained personal access tokens used after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
token_id (array)
The ID of the token
200 - OK
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/personal-access-token-requests
Response schema (Status: 200):
Array of Simple Organization Programmatic Access Grant Request:
id: required, integerreason: required, string or nullowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringrepository_selection: required, string, enum: none, all, subsetrepositories_url: required, stringpermissions: required, object:
organization: object, additional properties: stringrepository: object, additional properties: stringother: object, additional properties: stringcreated_at: required, stringtoken_id: required, integertoken_name: required, stringtoken_expired: required, booleantoken_expires_at: required, string or nulltoken_last_used_at: required, string or nullPOST /orgs/{org}/personal-access-token-requests
Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)pat_request_ids (array of integers)
Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 pat_request_id values.
action (string) (required)
Action to apply to the requests.
Can be one of: approve, deny
reason (string or null)
Reason for approving or denying the requests. Max 1024 characters.
202 - Accepted
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X POST \
https://api.github.com/orgs/ORG/personal-access-token-requests \
-d '{
"pat_request_ids": [
42,
73
],
"action": "deny",
"reason": "Access is too broad."
}'
Response schema (Status: 202):
object
POST /orgs/{org}/personal-access-token-requests/{pat_request_id}
Approves or denies a pending request to access organization resources via a fine-grained personal access token.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
pat_request_id (integer) (required)
Unique identifier of the request for access via fine-grained personal access token.
action (string) (required)
Action to apply to the request.
Can be one of: approve, deny
reason (string or null)
Reason for approving or denying the request. Max 1024 characters.
204 - A header with no content is returned.
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X POST \
https://api.github.com/orgs/ORG/personal-access-token-requests/PAT_REQUEST_ID \
-d '{
"action": "deny",
"reason": "This request is denied because the access is too broad."
}'
Response schema (Status: 204):
GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories
Lists the repositories a fine-grained personal access token request is requesting access to.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
pat_request_id (integer) (required)
Unique identifier of the request for access via fine-grained personal access token.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
403 - Forbidden
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/personal-access-token-requests/PAT_REQUEST_ID/repositories
Response schema (Status: 200):
Array of Minimal Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, booleanhtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: stringmirror_url: string or nullhooks_url: required, string, format: urisvn_url: stringhomepage: string or nulllanguage: string or nullforks_count: integerstargazers_count: integerwatchers_count: integersize: integerdefault_branch: stringopen_issues_count: integeris_template: booleantopics: array of stringhas_issues: booleanhas_projects: booleanhas_wiki: booleanhas_pages: booleanhas_discussions: booleanhas_pull_requests: booleanpull_request_creation_policy: string, enum: all, collaborators_onlyarchived: booleandisabled: booleanvisibility: stringpushed_at: string or null, format: date-timecreated_at: string or null, format: date-timeupdated_at: string or null, format: date-timepermissions: object:
admin: booleanmaintain: booleanpush: booleantriage: booleanpull: booleanrole_name: stringtemp_clone_token: stringdelete_branch_on_merge: booleansubscribers_count: integernetwork_count: integercode_of_conduct: Code Of Conduct:
key: required, stringname: required, stringurl: required, string, format: uribody: stringhtml_url: required, string or null, format: urilicense: object or null:
key: stringname: stringspdx_id: stringurl: string or nullnode_id: stringforks: integeropen_issues: integerwatchers: integerallow_forking: booleanweb_commit_signoff_required: booleansecurity_and_analysis: object or null:
advanced_security: object:
status: string, enum: enabled, disabledcode_security: object:
status: string, enum: enabled, disableddependabot_security_updates: object:
status: string, enum: enabled, disabledsecret_scanning: object:
status: string, enum: enabled, disabledsecret_scanning_push_protection: object:
status: string, enum: enabled, disabledsecret_scanning_non_provider_patterns: object:
status: string, enum: enabled, disabledsecret_scanning_ai_detection: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_alert_dismissal: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass_options: object:
reviewers: array of objects:
reviewer_id: required, integerreviewer_type: required, string, enum: TEAM, ROLEmode: string, enum: ALWAYS, EXEMPT, default: "ALWAYS"custom_properties: object, additional properties allowedGET /orgs/{org}/personal-access-tokens
Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
sort (string)
The property by which to sort the results.
Default: created_at
Can be one of: created_at
direction (string)
The direction to sort the results by.
Default: desc
Can be one of: asc, desc
owner (array)
A list of owner usernames to use to filter the results.
repository (string)
The name of the repository to use to filter the results.
permission (string)
The permission to use to filter the results.
last_used_before (string)
Only show fine-grained personal access tokens used before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
last_used_after (string)
Only show fine-grained personal access tokens used after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
token_id (array)
The ID of the token
200 - OK
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/personal-access-tokens
Response schema (Status: 200):
Array of Organization Programmatic Access Grant:
id: required, integerowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringrepository_selection: required, string, enum: none, all, subsetrepositories_url: required, stringpermissions: required, object:
organization: object, additional properties: stringrepository: object, additional properties: stringother: object, additional properties: stringaccess_granted_at: required, stringtoken_id: required, integertoken_name: required, stringtoken_expired: required, booleantoken_expires_at: required, string or nulltoken_last_used_at: required, string or nullPOST /orgs/{org}/personal-access-tokens
Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)action (string) (required)
Action to apply to the fine-grained personal access token.
Can be one of: revoke
pat_ids (array of integers) (required)
The IDs of the fine-grained personal access tokens.
202 - Accepted
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X POST \
https://api.github.com/orgs/ORG/personal-access-tokens \
-d '{
"action": "revoke",
"pat_ids": [
1296269,
1296280
]
}'
Response schema (Status: 202):
Same response schema as Review requests to access organization resources with fine-grained personal access tokens.
POST /orgs/{org}/personal-access-tokens/{pat_id}
Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
pat_id (integer) (required)
The unique identifier of the fine-grained personal access token.
action (string) (required)revoke204 - A header with no content is returned.
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X POST \
https://api.github.com/orgs/ORG/personal-access-tokens/PAT_ID \
-d '{
"action": "revoke"
}'
Response schema (Status: 204):
GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories
Lists the repositories a fine-grained personal access token has access to.
Only GitHub Apps can use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
pat_id (integer) (required)
Unique identifier of the fine-grained personal access token.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
403 - Forbidden
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/personal-access-tokens/PAT_ID/repositories
Response schema (Status: 200):
Same response schema as List repositories requested to be accessed by a fine-grained personal access token.