Enterprise Administration

Download Spec

Enterprise Administration

List global webhooks

get /admin/hooks

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "type": "Global",
    "id": 1,
    "name": "web",
    "active": true,
    "events": [
      "organization",
      "user"
    ],
    "config": {
      "url": "https://example.com",
      "content_type": "json",
      "insecure_ssl": "0",
      "secret": "********"
    },
    "updated_at": "2017-12-07T00:14:59Z",
    "created_at": "2017-12-07T00:14:59Z",
    "url": "https://api.github.com/admin/hooks/1",
    "ping_url": "https://api.github.com/admin/hooks/1/pings"
  }
]

array[object]

object

type

string

id

int

name

string

active

boolean

events

array[string]

string

config

object (config)

url

string

content_type

string

insecure_ssl

string

secret

string

updated_at

string

created_at

string

url

string

ping_url

string

Link

string

Create a global webhook

post /admin/hooks

name

string

required

Must be passed as "web".

config

object (config)

required

Key/value pairs to provide settings for this webhook.

url

string

required

The URL to which the payloads will be delivered.

content_type

string

The media type used to serialize the payloads. Supported values include json and form. The default is form.

secret

string

If provided, the secret will be used as the key to generate the HMAC hex digest value in the X-Hub-Signature header.

insecure_ssl

string

Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.

events

array[string]

The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.

string

active

boolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

Default
true

Request

{
  "name": "web",
  "events": [
    "organization",
    "user"
  ],
  "config": {
    "url": "https://example.com/webhook",
    "content_type": "json",
    "secret": "secret"
  }
}

Response

Examples Schema

Response

{
  "type": "Global",
  "id": 1,
  "name": "web",
  "active": true,
  "events": [
    "organization",
    "user"
  ],
  "config": {
    "url": "https://example.com",
    "content_type": "json",
    "insecure_ssl": "0",
    "secret": "********"
  },
  "updated_at": "2017-12-07T00:14:59Z",
  "created_at": "2017-12-07T00:14:59Z",
  "url": "https://api.github.com/admin/hooks/1",
  "ping_url": "https://api.github.com/admin/hooks/1/pings"
}

type

string

id

int

name

string

active

boolean

events

array[string]

string

config

object (config)

url

string

content_type

string

insecure_ssl

string

secret

string

updated_at

string

created_at

string

url

string

ping_url

string

Get a global webhook

get /admin/hooks/{hook_id}

hook_id

int

required

The unique identifier of the hook.

Response

Examples Schema

Response

{
  "type": "Global",
  "id": 1,
  "name": "web",
  "active": true,
  "events": [
    "organization",
    "user"
  ],
  "config": {
    "url": "https://example.com",
    "content_type": "json",
    "insecure_ssl": "0",
    "secret": "********"
  },
  "updated_at": "2017-12-07T00:14:59Z",
  "created_at": "2017-12-07T00:14:59Z",
  "url": "https://api.github.com/admin/hooks/1",
  "ping_url": "https://api.github.com/admin/hooks/1/pings"
}

type

string

id

int

name

string

active

boolean

events

array[string]

string

config

object (config)

url

string

content_type

string

insecure_ssl

string

secret

string

updated_at

string

created_at

string

url

string

ping_url

string

Delete a global webhook

delete /admin/hooks/{hook_id}

hook_id

int

required

The unique identifier of the hook.

Response

Examples Schema

Response

Empty response

No schema

Update a global webhook

patch /admin/hooks/{hook_id}

Parameters that are not provided will be overwritten with the default value or removed if no default exists.

hook_id

int

required

The unique identifier of the hook.

config

object (config)

Key/value pairs to provide settings for this webhook.

url

string

required

The URL to which the payloads will be delivered.

content_type

string

The media type used to serialize the payloads. Supported values include json and form. The default is form.

secret

string

If provided, the secret will be used as the key to generate the HMAC hex digest value in the X-Hub-Signature header.

insecure_ssl

string

Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.

events

array[string]

The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.

string

active

boolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

Default
true

Request

{
  "events": [
    "organization"
  ],
  "config": {
    "url": "https://example.com/webhook"
  }
}

Response

Examples Schema

Response

{
  "type": "Global",
  "id": 1,
  "name": "web",
  "active": true,
  "events": [
    "organization"
  ],
  "config": {
    "url": "https://example.com",
    "content_type": "form",
    "insecure_ssl": "0"
  },
  "updated_at": "2017-12-07T00:14:59Z",
  "created_at": "2017-12-07T00:14:59Z",
  "url": "https://api.github.com/admin/hooks/1",
  "ping_url": "https://api.github.com/admin/hooks/1/pings"
}

type

string

id

int

name

string

active

boolean

events

array[string]

string

config

object (config)

url

string

content_type

string

insecure_ssl

string

updated_at

string

created_at

string

url

string

ping_url

string

Ping a global webhook

post /admin/hooks/{hook_id}/pings

This will trigger a ping event to be sent to the webhook.

hook_id

int

required

The unique identifier of the hook.

Response

Examples Schema

Response

Empty response

No schema

List public keys

get /admin/keys

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

direction

string

The direction to sort the results by.

Default
"desc"
Enum
  • asc
  • desc

sort

string

Default
"created"
Enum
  • created
  • updated
  • accessed

since

string

Only show public keys accessed after the given time.

Response

Examples Schema

Response

[
  {
    "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234",
    "id": 2,
    "url": "https://api.github.com/user/keys/2",
    "title": "ssh-rsa AAAAB3NzaC1yc2EAAA",
    "created_at": "2020-06-11T21:31:57Z",
    "verified": false,
    "read_only": false,
    "last_used": "2020-06-11T22:31:57Z",
    "user_id": 1,
    "repository_id": 2
  },
  {
    "key": "9Og8iYjAyymI9LvABpJerYrMxURPc8r+dB7TJyvv1234",
    "id": 3,
    "url": "https://api.github.com/user/keys/2",
    "title": "ssh-rsa AAAAB3NzaC1yc2EAAA",
    "created_at": "2020-06-11T21:31:57Z",
    "verified": false,
    "read_only": false,
    "last_used": "2020-06-11T22:31:57Z",
    "user_id": 1,
    "repository_id": 2
  }
]

array[object]

object

id

int

required

key

string

required

user_id

int or null

required

repository_id

int or null

required

url

string

required

title

string

required

read_only

boolean

required

verified

boolean

required

created_at

string

date-time

required

added_by

string or null

last_used

string or null

date-time

required

Link

string

Delete a public key

delete /admin/keys/{key_ids}

key_ids

string

required

The unique identifier of the key.

Response

Examples Schema

Response

Empty response

No schema

Update LDAP mapping for a team

patch /admin/ldap/teams/{team_id}/mapping

Updates the distinguished name (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the Create a team endpoint to create a team with LDAP mapping.

team_id

int

required

The unique identifier of the team.

ldap_dn

string

required

The distinguished name (DN) of the LDAP entry to map to a team.

Request

{
  "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com"
}

Response

Examples Schema

Response

{
  "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com",
  "id": 1,
  "node_id": "MDQ6VGVhbTE=",
  "url": "https://api.github.com/teams/1",
  "html_url": "https://github.com/orgs/github/teams/justice-league",
  "name": "Justice League",
  "slug": "justice-league",
  "description": "A great team.",
  "privacy": "closed",
  "notification_setting": "notifications_enabled",
  "permission": "admin",
  "members_url": "https://api.github.com/teams/1/members{/member}",
  "repositories_url": "https://api.github.com/teams/1/repos",
  "parent": null
}

ldap_dn

string

id

int

node_id

string

url

string

html_url

string

name

string

slug

string

description

string or null

privacy

string

permission

string

members_url

string

repositories_url

string

parent

or null

Sync LDAP mapping for a team

post /admin/ldap/teams/{team_id}/sync

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

team_id

int

required

The unique identifier of the team.

Response

Examples Schema

Response

{
  "status": "queued"
}

status

string

Update LDAP mapping for a user

patch /admin/ldap/users/{username}/mapping

username

string

required

The handle for the GitHub user account.

ldap_dn

string

required

The distinguished name (DN) of the LDAP entry to map to a team.

Request

{
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}

Response

Examples Schema

Response

{
  "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com",
  "login": "octocat",
  "id": 1,
  "node_id": "MDQ6VXNlcjE=",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "octocat@github.com",
  "hireable": false,
  "bio": "There once was...",
  "twitter_username": "monatheoctocat",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z",
  "private_gists": 81,
  "total_private_repos": 100,
  "owned_private_repos": 100,
  "disk_usage": 10000,
  "collaborators": 8,
  "two_factor_authentication": true,
  "plan": {
    "name": "Medium",
    "space": 400,
    "private_repos": 20,
    "collaborators": 0
  }
}

ldap_dn

string

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

Example
"https://github.com/images/error/octocat_happy.gif"

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

name

string or null

required

Example
"monalisa octocat"

company

string or null

required

Example
"GitHub"

blog

string or null

required

Example
"https://github.com/blog"

location

string or null

required

Example
"San Francisco"

email

string or null

email

required

Example
"octocat@github.com"

hireable

boolean or null

required

bio

string or null

required

Example
"There once was..."

twitter_username

string or null

Example
"monalisa"

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

created_at

string

date-time

required

Example
"2008-01-14T04:33:35Z"

updated_at

string

date-time

required

Example
"2008-01-14T04:33:35Z"

private_gists

int

required

Example
81

total_private_repos

int

required

Example
100

owned_private_repos

int

required

Example
100

disk_usage

int

required

Example
10000

collaborators

int

required

Example
8

two_factor_authentication

boolean

required

Example
true

plan

object (plan)

collaborators

int

required

name

string

required

space

int

required

private_repos

int

required

suspended_at

string or null

date-time

business_plus

boolean

Sync LDAP mapping for a user

post /admin/ldap/users/{username}/sync

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

username

string

required

The handle for the GitHub user account.

Response

Examples Schema

Response

{
  "status": "queued"
}

status

string

Create an organization

post /admin/organizations

login

string

required

The organization's username.

admin

string

required

The login of the user who will manage this organization.

profile_name

string

The organization's display name.

Request

{
  "login": "github",
  "profile_name": "GitHub, Inc.",
  "admin": "monalisaoctocat"
}

Response

Examples Schema

Response

{
  "login": "github",
  "id": 1,
  "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
  "url": "https://api.github.com/orgs/github",
  "repos_url": "https://api.github.com/orgs/github/repos",
  "events_url": "https://api.github.com/orgs/github/events",
  "hooks_url": "https://api.github.com/orgs/github/hooks",
  "issues_url": "https://api.github.com/orgs/github/issues",
  "members_url": "https://api.github.com/orgs/github/members{/member}",
  "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "description": "A great organization"
}

login

string

required

Example
"github"

id

int

required

Example
1

node_id

string

required

Example
"MDEyOk9yZ2FuaXphdGlvbjE="

url

string

uri

required

Example
"https://api.github.com/orgs/github"

repos_url

string

uri

required

Example
"https://api.github.com/orgs/github/repos"

events_url

string

uri

required

Example
"https://api.github.com/orgs/github/events"

hooks_url

string

required

Example
"https://api.github.com/orgs/github/hooks"

issues_url

string

required

Example
"https://api.github.com/orgs/github/issues"

members_url

string

required

Example
"https://api.github.com/orgs/github/members{/member}"

public_members_url

string

required

Example
"https://api.github.com/orgs/github/public_members{/member}"

avatar_url

string

required

Example
"https://github.com/images/error/octocat_happy.gif"

description

string or null

required

Example
"A great organization"

Update an organization name

patch /admin/organizations/{org}

org

string

required

The organization name. The name is not case sensitive.

login

string

required

The organization's new name.

Request

{
  "login": "the-new-octocats"
}

Response

Examples Schema

Response

{
  "message": "Job queued to rename organization. It may take a few minutes to complete.",
  "url": "https://<hostname>/api/v3/organizations/1"
}

message

string

url

string

List pre-receive environments

get /admin/pre-receive-environments

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

direction

string

The direction to sort the results by.

Default
"desc"
Enum
  • asc
  • desc

sort

string

Default
"created"
Enum
  • created
  • updated
  • name

Response

Examples Schema

Response

[
  {
    "id": 1,
    "name": "Default",
    "image_url": "githubenterprise://internal",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/1",
    "html_url": "https://github.example.com/admin/pre-receive-environments/1",
    "default_environment": true,
    "created_at": "2016-05-20T11:35:45-05:00",
    "hooks_count": 14,
    "download": {
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest",
      "state": "not_started",
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null
    }
  },
  {
    "id": 2,
    "name": "DevTools Hook Env",
    "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
    "html_url": "https://github.example.com/admin/pre-receive-environments/2",
    "default_environment": false,
    "created_at": "2016-05-20T11:35:45-05:00",
    "hooks_count": 1,
    "download": {
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
      "state": "success",
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null
    }
  }
]

array[object]

object

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

Create a pre-receive environment

post /admin/pre-receive-environments

name

string

required

The new pre-receive environment's name.

image_url

string

required

URL from which to download a tarball of this environment.

Request

{
  "name": "DevTools Hook Env",
  "image_url": "https://my_file_server/path/to/devtools_env.tar.gz"
}

Response

Examples Schema

Response

{
  "id": 2,
  "name": "DevTools Hook Env",
  "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
  "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
  "html_url": "https://github.example.com/admin/pre-receive-environments/2",
  "default_environment": false,
  "created_at": "2016-05-20T11:35:45-05:00",
  "hooks_count": 1,
  "download": {
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
    "state": "not_started",
    "downloaded_at": null,
    "message": null
  }
}

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

Get a pre-receive environment

get /admin/pre-receive-environments/{pre_receive_environment_id}

pre_receive_environment_id

int

required

The unique identifier of the pre-receive environment.

Response

Examples Schema

Response

{
  "id": 2,
  "name": "DevTools Hook Env",
  "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
  "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
  "html_url": "https://github.example.com/admin/pre-receive-environments/2",
  "default_environment": false,
  "created_at": "2016-05-20T11:35:45-05:00",
  "hooks_count": 1,
  "download": {
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
    "state": "not_started",
    "downloaded_at": null,
    "message": null
  }
}

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

Delete a pre-receive environment

delete /admin/pre-receive-environments/{pre_receive_environment_id}

If you attempt to delete an environment that cannot be deleted, you will receive a 422 Unprocessable Entity response.

The possible error messages are:

  • Cannot modify or delete the default environment
  • Cannot delete environment that has hooks
  • Cannot delete environment when download is in progress

pre_receive_environment_id

int

required

The unique identifier of the pre-receive environment.

Response

Examples Schema

Response

Empty response

Client Errors

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "PreReceiveEnvironment",
      "code": "custom",
      "message": "Cannot modify or delete the default environment"
    }
  ]
}

No schema

message

string

errors

array[object]

object

resource

string

code

string

message

string

Update a pre-receive environment

patch /admin/pre-receive-environments/{pre_receive_environment_id}

You cannot modify the default environment. If you attempt to modify the default environment, you will receive a 422 Unprocessable Entity response.

pre_receive_environment_id

int

required

The unique identifier of the pre-receive environment.

name

string

This pre-receive environment's new name.

image_url

string

URL from which to download a tarball of this environment.

Request

{
  "name": "DevTools Hook Env",
  "image_url": "https://my_file_server/path/to/devtools_env.tar.gz"
}

Response

Examples Schema

Response

{
  "id": 2,
  "name": "DevTools Hook Env",
  "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
  "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
  "html_url": "https://github.example.com/admin/pre-receive-environments/2",
  "default_environment": false,
  "created_at": "2016-05-20T11:35:45-05:00",
  "hooks_count": 1,
  "download": {
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
    "state": "success",
    "downloaded_at": "2016-05-26T07:42:53-05:00",
    "message": null
  }
}

Client Errors

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "PreReceiveEnvironment",
      "code": "custom",
      "message": "Cannot modify or delete the default environment"
    }
  ]
}

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

message

string

errors

array[object]

object

resource

string

code

string

message

string

Start a pre-receive environment download

post /admin/pre-receive-environments/{pre_receive_environment_id}/downloads

Triggers a new download of the environment tarball from the environment's image_url. When the download is finished, the newly downloaded tarball will overwrite the existing environment.

If a download cannot be triggered, you will receive a 422 Unprocessable Entity response.

The possible error messages are:

  • Cannot modify or delete the default environment
  • Can not start a new download when a download is in progress

pre_receive_environment_id

int

required

The unique identifier of the pre-receive environment.

Response

Examples Schema

Response

{
  "url": "https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest",
  "state": "not_started",
  "downloaded_at": null,
  "message": null
}

Client Errors

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "PreReceiveEnvironment",
      "code": "custom",
      "message": "Can not start a new download when a download is in progress"
    }
  ]
}

url

string

state

string

downloaded_at

string or null

message

string or null

message

string

errors

array[object]

object

resource

string

code

string

message

string

Get the download status for a pre-receive environment

get /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest

In addition to seeing the download status at the "Get a pre-receive environment" endpoint, there is also this separate endpoint for just the download status.

pre_receive_environment_id

int

required

The unique identifier of the pre-receive environment.

Response

Examples Schema

Response

{
  "url": "https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest",
  "state": "success",
  "downloaded_at": "2016-05-26T07:42:53-05:00",
  "message": null
}

url

string

state

string

downloaded_at

string or null

message

string or null

List pre-receive hooks

get /admin/pre-receive-hooks

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

direction

string

The direction to sort the results by.

Default
"desc"
Enum
  • asc
  • desc

sort

string

The property to sort the results by.

Default
"created"
Enum
  • created
  • updated
  • name

Response

Examples Schema

Response

[
  {
    "id": 1,
    "name": "Check Commits",
    "enforcement": "disabled",
    "script": "scripts/commmit_check.sh",
    "script_repository": {
      "id": 595,
      "full_name": "DevIT/hooks",
      "url": "https://github.example.com/api/v3/repos/DevIT/hooks",
      "html_url": "https://github.example.com/DevIT/hooks"
    },
    "environment": {
      "id": 2,
      "name": "DevTools Hook Env",
      "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
      "html_url": "https://github.example.com/admin/pre-receive-environments/2",
      "default_environment": false,
      "created_at": "2016-05-20T11:35:45-05:00",
      "hooks_count": 1,
      "download": {
        "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
        "state": "success",
        "downloaded_at": "2016-05-26T07:42:53-05:00",
        "message": null
      }
    },
    "allow_downstream_configuration": false
  }
]

array[object]

object

id

int

name

string

enforcement

string

script

string

script_repository

object (script_repository)

id

int

full_name

string

url

string

html_url

string

environment

object (environment)

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

allow_downstream_configuration

boolean

Create a pre-receive hook

post /admin/pre-receive-hooks

name

string

required

The name of the hook.

script

string

required

The script that the hook runs.

script_repository

object (script_repository)

required

The GitHub repository where the script is kept.

environment

object (environment)

required

The pre-receive environment where the script is executed.

enforcement

string

The state of enforcement for this hook. default: disabled

allow_downstream_configuration

boolean

Whether enforcement can be overridden at the org or repo level. default: false

Request

{
  "name": "Check Commits",
  "script": "scripts/commit_check.sh",
  "enforcement": "disabled",
  "allow_downstream_configuration": false,
  "script_repository": {
    "full_name": "DevIT/hooks"
  },
  "environment": {
    "id": 2
  }
}

Response

Examples Schema

Response

{
  "id": 1,
  "name": "Check Commits",
  "enforcement": "disabled",
  "script": "scripts/commmit_check.sh",
  "script_repository": {
    "id": 595,
    "full_name": "DevIT/hooks",
    "url": "https://github.example.com/api/v3/repos/DevIT/hooks",
    "html_url": "https://github.example.com/DevIT/hooks"
  },
  "environment": {
    "id": 2,
    "name": "DevTools Hook Env",
    "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
    "html_url": "https://github.example.com/admin/pre-receive-environments/2",
    "default_environment": false,
    "created_at": "2016-05-20T11:35:45-05:00",
    "hooks_count": 1,
    "download": {
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
      "state": "success",
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null
    }
  },
  "allow_downstream_configuration": false
}

id

int

name

string

enforcement

string

script

string

script_repository

object (script_repository)

id

int

full_name

string

url

string

html_url

string

environment

object (environment)

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

allow_downstream_configuration

boolean

Get a pre-receive hook

get /admin/pre-receive-hooks/{pre_receive_hook_id}

pre_receive_hook_id

int

required

The unique identifier of the pre-receive hook.

Response

Examples Schema

Response

{
  "id": 1,
  "name": "Check Commits",
  "enforcement": "disabled",
  "script": "scripts/commmit_check.sh",
  "script_repository": {
    "id": 595,
    "full_name": "DevIT/hooks",
    "url": "https://github.example.com/api/v3/repos/DevIT/hooks",
    "html_url": "https://github.example.com/DevIT/hooks"
  },
  "environment": {
    "id": 2,
    "name": "DevTools Hook Env",
    "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2",
    "html_url": "https://github.example.com/admin/pre-receive-environments/2",
    "default_environment": false,
    "created_at": "2016-05-20T11:35:45-05:00",
    "hooks_count": 1,
    "download": {
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest",
      "state": "success",
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null
    }
  },
  "allow_downstream_configuration": false
}

id

int

name

string

enforcement

string

script

string

script_repository

object (script_repository)

id

int

full_name

string

url

string

html_url

string

environment

object (environment)

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

allow_downstream_configuration

boolean

Delete a pre-receive hook

delete /admin/pre-receive-hooks/{pre_receive_hook_id}

pre_receive_hook_id

int

required

The unique identifier of the pre-receive hook.

Response

Examples Schema

Response

Empty response

No schema

Update a pre-receive hook

patch /admin/pre-receive-hooks/{pre_receive_hook_id}

pre_receive_hook_id

int

required

The unique identifier of the pre-receive hook.

name

string

The name of the hook.

script

string

The script that the hook runs.

script_repository

object (script_repository)

The GitHub repository where the script is kept.

environment

object (environment)

The pre-receive environment where the script is executed.

enforcement

string

The state of enforcement for this hook.

allow_downstream_configuration

boolean

Whether enforcement can be overridden at the org or repo level.

Request

{
  "name": "Check Commits",
  "environment": {
    "id": 1
  },
  "allow_downstream_configuration": true
}

Response

Examples Schema

Response

{
  "id": 1,
  "name": "Check Commits",
  "enforcement": "disabled",
  "script": "scripts/commmit_check.sh",
  "script_repository": {
    "id": 595,
    "full_name": "DevIT/hooks",
    "url": "https://github.example.com/api/v3/repos/DevIT/hooks",
    "html_url": "https://github.example.com/DevIT/hooks"
  },
  "environment": {
    "id": 1,
    "name": "Default",
    "image_url": "githubenterprise://internal",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/1",
    "html_url": "https://github.example.com/admin/pre-receive-environments/1",
    "default_environment": true,
    "created_at": "2016-05-20T11:35:45-05:00",
    "hooks_count": 1,
    "download": {
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest",
      "state": "success",
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null
    }
  },
  "allow_downstream_configuration": true
}

id

int

name

string

enforcement

string

script

string

script_repository

object (script_repository)

id

int

full_name

string

url

string

html_url

string

environment

object (environment)

id

int

name

string

image_url

string

url

string

html_url

string

default_environment

boolean

created_at

string

hooks_count

int

download

object (download)

url

string

state

string

downloaded_at

string or null

message

string or null

allow_downstream_configuration

boolean

List personal access tokens

get /admin/tokens

Lists personal access tokens for all users, including admin users.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "id": 2,
    "url": "https://enterprise.octocat.com/api/v3/authorizations/2",
    "app": {
      "name": "My personal access token",
      "url": "https://docs.github.com/enterprise/rest/reference/enterprise-admin#list-personal-access-tokens",
      "client_id": "00000000000000000000"
    },
    "token": "ghp_16C7e42F292c6912E7710c838347Ae178B4a",
    "hashed_token": "23cffb2fab1b0a62747863eba88cb9327e561f2f7a0c8661c0d9b83146cb8d45",
    "token_last_eight": "Ae178B4a",
    "note": "My personal access token",
    "note_url": null,
    "created_at": "2019-04-24T21:49:02Z",
    "updated_at": "2019-04-24T21:49:02Z",
    "scopes": [
      "admin:business",
      "admin:gpg_key",
      "admin:org",
      "admin:org_hook",
      "admin:pre_receive_hook",
      "admin:public_key",
      "admin:repo_hook",
      "delete_repo",
      "gist",
      "notifications",
      "repo",
      "user",
      "write:discussion"
    ],
    "fingerprint": null
  }
]

array[object (Authorization)]

Authorization

object (Authorization)

The authorization for an OAuth app, GitHub App, or a Personal Access Token.

id

int

required

url

string

uri

required

scopes

array[string] or null

required

A list of scopes that this authorization is in.

string

token

string

required

token_last_eight

string or null

required

hashed_token

string or null

required

app

object (app)

required

client_id

string

required

name

string

required

url

string

uri

required

note

string or null

required

note_url

string or null

uri

required

updated_at

string

date-time

required

created_at

string

date-time

required

fingerprint

string or null

required

user

object (user) or null

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

Example
"https://github.com/images/error/octocat_happy.gif"

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

installation

object (installation) or null

permissions

object (permissions)

required

The permissions granted to the user-to-server access token.

Example
{ "contents": "read", "issues": "read", "deployments": "write", "single_file": "read" }

actions

string

The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.

Enum
  • read
  • write

administration

string

The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.

Enum
  • read
  • write

checks

string

The level of permission to grant the access token for checks on code.

Enum
  • read
  • write

contents

string

The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.

Enum
  • read
  • write

deployments

string

The level of permission to grant the access token for deployments and deployment statuses.

Enum
  • read
  • write

environments

string

The level of permission to grant the access token for managing repository environments.

Enum
  • read
  • write

issues

string

The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.

Enum
  • read
  • write

metadata

string

The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.

Enum
  • read
  • write

packages

string

The level of permission to grant the access token for packages published to GitHub Packages.

Enum
  • read
  • write

pages

string

The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.

Enum
  • read
  • write

pull_requests

string

The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.

Enum
  • read
  • write

repository_hooks

string

The level of permission to grant the access token to manage the post-receive hooks for a repository.

Enum
  • read
  • write

repository_projects

string

The level of permission to grant the access token to manage repository projects, columns, and cards.

Enum
  • read
  • write
  • admin

secret_scanning_alerts

string

The level of permission to grant the access token to view and manage secret scanning alerts.

Enum
  • read
  • write

secrets

string

The level of permission to grant the access token to manage repository secrets.

Enum
  • read
  • write

security_events

string

The level of permission to grant the access token to view and manage security events like code scanning alerts.

Enum
  • read
  • write

single_file

string

The level of permission to grant the access token to manage just a single file.

Enum
  • read
  • write

statuses

string

The level of permission to grant the access token for commit statuses.

Enum
  • read
  • write

vulnerability_alerts

string

The level of permission to grant the access token to manage Dependabot alerts.

Enum
  • read
  • write

workflows

string

The level of permission to grant the access token to update GitHub Actions workflow files.

Enum
  • write

members

string

The level of permission to grant the access token for organization teams and members.

Enum
  • read
  • write

organization_administration

string

The level of permission to grant the access token to manage access to an organization.

Enum
  • read
  • write

organization_custom_roles

string

The level of permission to grant the access token for custom repository roles management. This property is in beta and is subject to change.

Enum
  • read
  • write

organization_announcement_banners

string

The level of permission to grant the access token to view and manage announcement banners for an organization.

Enum
  • read
  • write

organization_hooks

string

The level of permission to grant the access token to manage the post-receive hooks for an organization.

Enum
  • read
  • write

organization_personal_access_tokens

string

The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.

Enum
  • read
  • write

organization_personal_access_token_requests

string

The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.

Enum
  • read
  • write

organization_plan

string

The level of permission to grant the access token for viewing an organization's plan.

Enum
  • read

organization_projects

string

The level of permission to grant the access token to manage organization projects and projects beta (where available).

Enum
  • read
  • write
  • admin

organization_packages

string

The level of permission to grant the access token for organization packages published to GitHub Packages.

Enum
  • read
  • write

organization_secrets

string

The level of permission to grant the access token to manage organization secrets.

Enum
  • read
  • write

organization_self_hosted_runners

string

The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.

Enum
  • read
  • write

organization_user_blocking

string

The level of permission to grant the access token to view and manage users blocked by the organization.

Enum
  • read
  • write

team_discussions

string

The level of permission to grant the access token to manage team discussions and related comments.

Enum
  • read
  • write

repository_selection

string

required

Describe whether all repositories have been selected or there's a selection involved

Enum
  • all
  • selected

single_file_name

string or null

required

Example
"config.yaml"

has_multiple_single_files

boolean

Example
true

single_file_paths

array[string]

Example
[ "config.yml", ".github/issue_TEMPLATE.md" ]

string

repositories_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

account

object (account)

required

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

Example
"https://github.com/images/error/octocat_happy.gif"

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

expires_at

string or null

date-time

required

Link

string

Delete a personal access token

delete /admin/tokens/{token_id}

Deletes a personal access token. Returns a 403 - Forbidden status when a personal access token is in use. For example, if you access this endpoint with the same personal access token that you are trying to delete, you will receive this error.

token_id

int

required

The unique identifier of the token.

Response

Examples Schema

Response

Empty response

No schema

Create a user

post /admin/users

If an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also update the LDAP mapping for the user.

The login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send "octo_cat" as the login, a user named "octo-cat" will be created.

If the login name or email address is already associated with an account, the server will return a 422 response.

login

string

required

The user's username.

email

string

Required for built-in authentication. The user's email address. This parameter can be omitted when using CAS, LDAP, or SAML. For more information, see "About authentication for your enterprise."

suspended

boolean

Whether to set the user as suspended when the user is created.

Default
false

Request

{
  "login": "monalisa",
  "email": "octocat@github.com"
}

Response

Examples Schema

Response

{
  "login": "octocat",
  "id": 1,
  "node_id": "MDQ6VXNlcjE=",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false
}

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

Example
"https://github.com/images/error/octocat_happy.gif"

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

Delete a user

delete /admin/users/{username}

Deleting a user will delete all their repositories, gists, applications, and personal settings. Suspending a user is often a better option.

You can delete any user account except your own.

username

string

required

The handle for the GitHub user account.

Response

Examples Schema

Response

Empty response

No schema

Update the username for a user

patch /admin/users/{username}

username

string

required

The handle for the GitHub user account.

login

string

required

The user's new username.

Request

{
  "login": "thenewmonalisa"
}

Response

Examples Schema

Response

{
  "message": "Job queued to rename user. It may take a few minutes to complete.",
  "url": "https://api.github.com/user/1"
}

message

string

url

string

Create an impersonation OAuth token

post /admin/users/{username}/authorizations

username

string

required

The handle for the GitHub user account.

scopes

array[string]

required

A list of scopes.

string

Request

{
  "scopes": [
    "public_repo"
  ]
}

Response

Examples Schema

Response when creating a new impersonation OAuth token

{
  "id": 1,
  "url": "https://api.github.com/authorizations/1",
  "scopes": [
    "public_repo"
  ],
  "token": "ghu_16C7e42F292c6912E7710c838347Ae178B4a",
  "token_last_eight": "Ae178B4a",
  "hashed_token": "25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8",
  "app": {
    "url": "http://my-github-app.com",
    "name": "my github app",
    "client_id": "abcde12345fghij67890"
  },
  "note": "optional note",
  "note_url": "http://optional/note/url",
  "updated_at": "2011-09-06T20:39:23Z",
  "created_at": "2011-09-06T17:26:27Z",
  "expires_at": "2011-10-06T17:26:27Z",
  "fingerprint": "jklmnop12345678"
}

Response when getting an existing impersonation OAuth token

{
  "id": 1,
  "url": "https://api.github.com/authorizations/1",
  "scopes": [
    "public_repo"
  ],
  "token": "ghu_16C7e42F292c6912E7710c838347Ae178B4a",
  "token_last_eight": "Ae178B4a",
  "hashed_token": "25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8",
  "app": {
    "url": "http://my-github-app.com",
    "name": "my github app",
    "client_id": "abcde12345fghij67890"
  },
  "note": "optional note",
  "note_url": "http://optional/note/url",
  "updated_at": "2011-09-06T20:39:23Z",
  "created_at": "2011-09-06T17:26:27Z",
  "expires_at": "2011-10-06T17:26:27Z",
  "fingerprint": "jklmnop12345678"
}

id

int

required

url

string

uri

required

scopes

array[string] or null

required

A list of scopes that this authorization is in.

string

token

string

required

token_last_eight

string or null

required

hashed_token

string or null

required

app

object (app)

required

client_id

string

required

name

string

required

url

string

uri

required

note

string or null

required

note_url

string or null

uri

required

updated_at

string

date-time

required

created_at

string

date-time

required

fingerprint

string or null

required

user

object (user) or null

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

Example
"https://github.com/images/error/octocat_happy.gif"

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

Example
"https://api.github.com/users/octocat"

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

Example
"https://api.github.com/users/octocat/followers"

following_url

string

required

Example
"https://api.github.com/users/octocat/following{/other_user}"

gists_url

string

required

Example
"https://api.github.com/users/octocat/gists{/gist_id}"

starred_url

string

required

Example
"https://api.github.com/users/octocat/starred{/owner}{/repo}"

subscriptions_url

string

uri

required

Example
"https://api.github.com/users/octocat/subscriptions"

organizations_url

string

uri

required

Example
"https://api.github.com/users/octocat/orgs"

repos_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

events_url

string

required

Example
"https://api.github.com/users/octocat/events{/privacy}"

received_events_url

string

uri

required

Example
"https://api.github.com/users/octocat/received_events"

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

installation

object (installation) or null

permissions

object (permissions)

required

The permissions granted to the user-to-server access token.

Example
{ "contents": "read", "issues": "read", "deployments": "write", "single_file": "read" }

actions

string

The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.

Enum
  • read
  • write

administration

string

The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.

Enum
  • read
  • write

checks

string

The level of permission to grant the access token for checks on code.

Enum
  • read
  • write

contents

string

The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.

Enum
  • read
  • write

deployments

string

The level of permission to grant the access token for deployments and deployment statuses.

Enum
  • read
  • write

environments

string

The level of permission to grant the access token for managing repository environments.

Enum
  • read
  • write

issues

string

The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.

Enum
  • read
  • write

metadata

string

The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.

Enum
  • read
  • write

packages

string

The level of permission to grant the access token for packages published to GitHub Packages.

Enum
  • read
  • write

pages

string

The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.

Enum
  • read
  • write

pull_requests

string

The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.

Enum
  • read
  • write

repository_hooks

string

The level of permission to grant the access token to manage the post-receive hooks for a repository.

Enum
  • read
  • write

repository_projects

string

The level of permission to grant the access token to manage repository projects, columns, and cards.

Enum
  • read
  • write
  • admin

secret_scanning_alerts

string

The level of permission to grant the access token to view and manage secret scanning alerts.

Enum
  • read
  • write

secrets

string

The level of permission to grant the access token to manage repository secrets.

Enum
  • read
  • write

security_events

string

The level of permission to grant the access token to view and manage security events like code scanning alerts.

Enum
  • read
  • write

single_file

string

The level of permission to grant the access token to manage just a single file.

Enum
  • read
  • write

statuses

string

The level of permission to grant the access token for commit statuses.

Enum
  • read
  • write

vulnerability_alerts

string

The level of permission to grant the access token to manage Dependabot alerts.

Enum
  • read
  • write

workflows

string

The level of permission to grant the access token to update GitHub Actions workflow files.

Enum
  • write

members

string

The level of permission to grant the access token for organization teams and members.

Enum
  • read
  • write

organization_administration

string

The level of permission to grant the access token to manage access to an organization.

Enum
  • read
  • write

organization_custom_roles

string

The level of permission to grant the access token for custom repository roles management. This property is in beta and is subject to change.

Enum
  • read
  • write

organization_announcement_banners

string

The level of permission to grant the access token to view and manage announcement banners for an organization.

Enum
  • read
  • write

organization_hooks

string

The level of permission to grant the access token to manage the post-receive hooks for an organization.

Enum
  • read
  • write

organization_personal_access_tokens

string

The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.

Enum
  • read
  • write

organization_personal_access_token_requests

string

The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.

Enum
  • read
  • write

organization_plan

string

The level of permission to grant the access token for viewing an organization's plan.

Enum
  • read

organization_projects

string

The level of permission to grant the access token to manage organization projects and projects beta (where available).

Enum
  • read
  • write
  • admin

organization_packages

string

The level of permission to grant the access token for organization packages published to GitHub Packages.

Enum
  • read
  • write

organization_secrets

string

The level of permission to grant the access token to manage organization secrets.

Enum
  • read
  • write

organization_self_hosted_runners

string

The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.

Enum
  • read
  • write

organization_user_blocking

string

The level of permission to grant the access token to view and manage users blocked by the organization.

Enum
  • read
  • write

team_discussions

string

The level of permission to grant the access token to manage team discussions and related comments.

Enum
  • read
  • write

repository_selection

string

required

Describe whether all repositories have been selected or there's a selection involved

Enum
  • all
  • selected

single_file_name

string or null

required

Example
"config.yaml"

has_multiple_single_files

boolean

Example
true

single_file_paths

array[string]

Example
[ "config.yml", ".github/issue_TEMPLATE.md" ]

string

repositories_url

string

uri

required

Example
"https://api.github.com/users/octocat/repos"

account

object (account)

required

A GitHub user.

name

string or null

email

string or null

login

string

required