GitHub Add API
The Add API from GitHub — 4 operation(s) for add.
The Add API from GitHub — 4 operation(s) for add.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/github:github-add-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Github Add API
version: 1.1.4
contact:
name: Support
url: https://support.github.com/contact?tags=dotcom-rest-api
license:
name: MIT
url: https://spdx.org/licenses/MIT
termsOfService: https://docs.github.com/articles/github-terms-of-service
x-github-plan: ghes
x-github-release: 3.9
description: 'Operations tagged Add across 3 of this provider''s published API definitions: github-auth-api-openapi.yml, github-projects-openapi.yml, github-setup-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
tags:
- name: Add
paths:
/setup/api/settings/authorized-keys:
post:
summary: GitHub Add an Authorized Ssh Key
description: '**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.'
operationId: addAnAuthorizedSshKey
tags:
- Add
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/enterprise-admin/management-console#add-an-authorized-ssh-key
servers:
- url: '{protocol}://{hostname}'
variables:
hostname:
default: HOSTNAME
description: Self-hosted Enterprise Server hostname
protocol:
default: http
description: Self-hosted Enterprise Server protocol
responses:
'201':
description: Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ssh-key'
examples:
default:
$ref: '#/components/examples/ssh-key-items'
'401':
description: Unauthorized
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
authorized_key:
type: string
description: The public SSH key.
required:
- authorized_key
examples:
default:
value:
authorized_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==
x-github:
githubCloudOnly: false
enabledForGitHubApps: false
category: enterprise-admin
subcategory: management-console
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: api.github.com
protocol:
description: Self-hosted Enterprise Server protocol
default: https
/orgs/{org}/teams/{team_slug}/projects/{project_id}:
put:
summary: GitHub Add or Update Team Project Permissions
description: 'Adds an organization project to a team. To add a project to a team or update the team''s permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.
**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`.'
tags:
- Add
operationId: addOrUpdateTeamProjectPermissions
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-project-permissions
parameters:
- $ref: '#/components/parameters/org'
- $ref: '#/components/parameters/team-slug'
- $ref: '#/components/parameters/project-id'
requestBody:
required: false
content:
application/json:
schema:
type:
- object
- 'null'
properties:
permission:
type: string
description: 'The permission to grant to the team for this project. Default: the team''s `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you''ll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.9/rest/guides/getting-started-with-the-rest-api#http-method)."'
enum:
- read
- write
- admin
examples:
default:
summary: Updates the permissions for the team to write for the project
value:
permission: write
responses:
'204':
description: Response
'403':
description: Forbidden if the project is not owned by the organization
content:
application/json:
schema:
type: object
properties:
message:
type: string
documentation_url:
type: string
examples:
response-if-the-project-is-not-owned-by-the-organization:
value:
message: Must have admin rights to Repository.
documentation_url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-project-permissions
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: teams
subcategory: teams
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: HOSTNAME
protocol:
description: Self-hosted Enterprise Server protocol
default: http
/projects/{project_id}/collaborators/{username}:
put:
summary: GitHub Add Project Collaborator
description: Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator.
tags:
- Add
operationId: addProjectCollaborator
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/projects/collaborators#add-project-collaborator
parameters:
- $ref: '#/components/parameters/project-id'
- $ref: '#/components/parameters/username'
requestBody:
required: false
content:
application/json:
schema:
type:
- object
- 'null'
properties:
permission:
description: The permission to grant the collaborator.
enum:
- read
- write
- admin
default: write
example: write
type: string
examples:
default:
summary: Applying write permissions for the new collaborator
value:
permission: write
responses:
'204':
description: Response
'304':
$ref: '#/components/responses/not_modified'
'401':
$ref: '#/components/responses/requires_authentication'
'403':
$ref: '#/components/responses/forbidden'
'404':
$ref: '#/components/responses/not_found'
'422':
$ref: '#/components/responses/validation_failed'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: projects
subcategory: collaborators
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: HOSTNAME
protocol:
description: Self-hosted Enterprise Server protocol
default: http
/teams/{team_id}/projects/{project_id}:
put:
summary: GitHub Add or Update Team Project Permissions (legacy)
description: '**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Add or update team project permissions endpoint.
Adds an organization project to a team. To add a project to a team or update the team''s permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.'
tags:
- Add
operationId: addOrUpdateTeamProjectPermissionsLegacy
externalDocs:
description: API method documentation
url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-project-permissions-legacy
parameters:
- $ref: '#/components/parameters/team-id'
- $ref: '#/components/parameters/project-id'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
permission:
type: string
description: 'The permission to grant to the team for this project. Default: the team''s `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you''ll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.9/rest/guides/getting-started-with-the-rest-api#http-method)."'
enum:
- read
- write
- admin
examples:
default:
summary: Example of setting permission to read
value:
permission: read
responses:
'204':
description: Response
'403':
description: Forbidden if the project is not owned by the organization
content:
application/json:
schema:
type: object
properties:
message:
type: string
documentation_url:
type: string
examples:
response-if-the-project-is-not-owned-by-the-organization:
value:
message: Must have admin rights to Repository.
documentation_url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-project-permissions
'404':
$ref: '#/components/responses/not_found'
'422':
$ref: '#/components/responses/validation_failed'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
removalDate: '2021-02-01'
deprecationDate: '2020-01-21'
category: teams
subcategory: teams
deprecated: true
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: HOSTNAME
protocol:
description: Self-hosted Enterprise Server protocol
default: http
components:
examples:
ssh-key-items:
value:
- key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...
pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64
- key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...
pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64
- key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...
pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64
schemas:
ssh-key:
type: object
properties:
key:
type: string
example: example_value
pretty-print:
type: string
example: example_value
validation-error:
title: Validation Error
description: Validation Error
type: object
required:
- message
- documentation_url
properties:
message:
type: string
example: Example body text
documentation_url:
type: string
example: https://api.github.com/repos/octocat/Hello-World
errors:
type: array
items:
type: object
required:
- code
properties:
resource:
type: string
field:
type: string
message:
type: string
code:
type: string
index:
type: integer
value:
oneOf:
- type:
- string
- 'null'
- type:
- integer
- 'null'
- type:
- array
- 'null'
items:
type: string
basic-error:
title: Basic Error
description: Basic Error
type: object
properties:
message:
type: string
example: Example body text
documentation_url:
type: string
example: https://api.github.com/repos/octocat/Hello-World
url:
type: string
example: https://api.github.com/repos/octocat/Hello-World
status:
type: string
example: open
parameters:
project-id:
name: project_id
description: The unique identifier of the project.
in: path
required: true
schema:
type: integer
org:
name: org
description: The organization name. The name is not case sensitive.
in: path
required: true
schema:
type: string
team-id:
name: team_id
description: The unique identifier of the team.
in: path
required: true
schema:
type: integer
username:
name: username
description: The handle for the GitHub user account.
in: path
required: true
schema:
type: string
team-slug:
name: team_slug
description: The slug of the team name.
in: path
required: true
schema:
type: string
responses:
validation_failed:
description: Validation failed, or the endpoint has been spammed.
content:
application/json:
schema:
$ref: '#/components/schemas/validation-error'
not_modified:
description: Not modified
requires_authentication:
description: Requires authentication
content:
application/json:
schema:
$ref: '#/components/schemas/basic-error'
not_found:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/basic-error'
forbidden:
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/basic-error'
securitySchemes:
bearerHttpAuthentication:
description: Bearer Token
type: http
scheme: Bearer
externalDocs:
description: GitHub Enterprise Developer Docs
url: https://docs.github.com/enterprise-server@3.9/rest/
x-refined-from:
- github-auth-api-openapi.yml
- github-projects-openapi.yml
- github-setup-openapi.yml