GitHub v3 REST API

Set settings

For a list of the available settings, see the Get settings endpoint.

Note: The request body for this operation must be submitted as application/x-www-form-urlencoded data. You can submit a parameter value as a string, or you can use a tool such as curl to submit a parameter value as the contents of a text file. For more information, see the curl documentation.

put
http://HOSTNAME/api/v3/setup/api/settings

Body

application/x-www-form-urlencoded
settingsstringrequired

A JSON string with the new settings. Note that you only need to pass the specific settings you want to modify. For a list of the available settings, see the Get settings endpoint.

Response

204

Response

put/setup/api/settings

Body

{ "settings": "{ \"enterprise\": { \"public_pages\": true }}" }
 
204

Get all authorized SSH keys

get
http://HOSTNAME/api/v3/setup/api/settings/authorized-keys

Response

200 application/json

Response

keystring
pretty-printstring
get/setup/api/settings/authorized-keys
 
200 application/json

Add an authorized SSH key

Note: The request body for this operation must be submitted as application/x-www-form-urlencoded data. You can submit a parameter value as a string, or you can use a tool such as curl to submit a parameter value as the contents of a text file. For more information, see the curl documentation.

post
http://HOSTNAME/api/v3/setup/api/settings/authorized-keys

Body

application/x-www-form-urlencoded
authorized_keystringrequired

The public SSH key.

Response

201 application/json

Response

keystring
pretty-printstring
post/setup/api/settings/authorized-keys

Body

{ "authorized_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==" }
 
201 application/json

Remove an authorized SSH key

Note: The request body for this operation must be submitted as application/x-www-form-urlencoded data. You can submit a parameter value as a string, or you can use a tool such as curl to submit a parameter value as the contents of a text file. For more information, see the curl documentation.

delete
http://HOSTNAME/api/v3/setup/api/settings/authorized-keys

Body

application/x-www-form-urlencoded
authorized_keystringrequired

The public SSH key.

Response

200 application/json

Response

keystring
pretty-printstring
delete/setup/api/settings/authorized-keys

Body

{ "authorized_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==" }
 
200 application/json

Create a GitHub license

When you boot a GitHub instance for the first time, you can use the following endpoint to upload a license.

Note that you need to POST to /setup/api/configure to start the actual configuration process.

When using this endpoint, your GitHub instance must have a password set. This can be accomplished two ways:

  1. If you’re working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.
  2. If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.

Note: The request body for this operation must be submitted as application/x-www-form-urlencoded data. You can submit a parameter value as a string, or you can use a tool such as curl to submit a parameter value as the contents of a text file. For more information, see the curl documentation.

post
http://HOSTNAME/api/v3/setup/api/start

Body

application/x-www-form-urlencoded
licensestringrequired

The content of your .ghl license file.

passwordstring

You must provide a password only if you are uploading your license for the first time. If you previously set a password through the web interface, you don’t need this parameter.

settingsstring

An optional JSON string containing the installation settings. For a list of the available settings, see the Get settings endpoint.

Response

202

Response

post/setup/api/start

Body

{ "license": "license" }
 
202