Back to GithubList fine-grained personal access tokens with access to organization resources
Lists approved fine-grained personal access tokens owned by organization members that can access organization resources. Only GitHub Apps can call this API,
using the organization_personal_access_tokens: read
permission.
Note: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change.
Input
type: object
properties:
parameters:
type: object
properties:
org:
type: string
description: The organization name. The name is not case sensitive.
per_page:
type: integer
default: 30
description: The number of results per page (max 100).
page:
type: integer
default: 1
description: Page number of the results to fetch.
sort:
type: string
enum:
- created_at
default: created_at
description: The property by which to sort the results.
direction:
type: string
enum:
- asc
- desc
default: desc
description: The direction to sort the results by.
owner:
type: array
maxItems: 10
items:
type: string
example: owner[]=octocat1,owner[]=octocat2
description: A list of owner usernames to use to filter the results.
repository:
type: string
example: Hello-World
description: The name of the repository to use to filter the results.
permission:
type: string
example: issues_read
description: The permission to use to filter the results.
last_used_before:
type: string
format: date-time
description: >-
Only show fine-grained personal access tokens used before the given
time. This is a timestamp in [ISO
8601](https://en.wikipedia.org/wiki/ISO_8601) format:
`YYYY-MM-DDTHH:MM:SSZ`.
last_used_after:
type: string
format: date-time
description: >-
Only show fine-grained personal access tokens used after the given
time. This is a timestamp in [ISO
8601](https://en.wikipedia.org/wiki/ISO_8601) format:
`YYYY-MM-DDTHH:MM:SSZ`.
required:
- org
title: Parameters
Output
type: array
items:
type: object
title: Organization Programmatic Access Grant
properties:
id:
type: integer
description: >-
Unique identifier of the fine-grained personal access token. The
`pat_id` used to get details about an approved fine-grained personal
access token.
owner:
type: object
title: Simple User
properties:
name:
nullable: true
type: string
email:
nullable: true
type: string
login:
type: string
example: octocat
id:
type: integer
example: 1
node_id:
type: string
example: MDQ6VXNlcjE=
avatar_url:
type: string
format: uri
example: https://github.com/images/error/octocat_happy.gif
gravatar_id:
type: string
example: 41d064eb2195891e12d0413f63227ea7
nullable: true
url:
type: string
format: uri
example: https://api.github.com/users/octocat
html_url:
type: string
format: uri
example: https://github.com/octocat
followers_url:
type: string
format: uri
example: https://api.github.com/users/octocat/followers
following_url:
type: string
example: https://api.github.com/users/octocat/following{/other_user}
gists_url:
type: string
example: https://api.github.com/users/octocat/gists{/gist_id}
starred_url:
type: string
example: https://api.github.com/users/octocat/starred{/owner}{/repo}
subscriptions_url:
type: string
format: uri
example: https://api.github.com/users/octocat/subscriptions
organizations_url:
type: string
format: uri
example: https://api.github.com/users/octocat/orgs
repos_url:
type: string
format: uri
example: https://api.github.com/users/octocat/repos
events_url:
type: string
example: https://api.github.com/users/octocat/events{/privacy}
received_events_url:
type: string
format: uri
example: https://api.github.com/users/octocat/received_events
type:
type: string
example: User
site_admin:
type: boolean
starred_at:
type: string
example: '"2020-07-09T00:17:55Z"'
repository_selection:
type: string
enum:
- none
- all
- subset
description: Type of repository selection requested.
repositories_url:
type: string
description: >-
URL to the list of repositories the fine-grained personal access token
can access. Only follow when `repository_selection` is `subset`.
permissions:
type: object
properties:
organization:
type: object
repository:
type: object
other:
type: object
access_granted_at:
type: string
description: >-
Date and time when the fine-grained personal access token was approved
to access the organization.
token_expired:
type: boolean
description: Whether the associated fine-grained personal access token has expired.
token_expires_at:
type: string
nullable: true
description: >-
Date and time when the associated fine-grained personal access token
expires.
token_last_used_at:
type: string
nullable: true
description: >-
Date and time when the associated fine-grained personal access token was
last used for authentication.