Skip to main content

Create a deploy key

You can create a read-only deploy key.

POST/repos/{owner}/{repo}/keys
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
owner string
required
repo string
required
Body Params
required
application/jsonobject
key string
required

The contents of the key.

read_only boolean
optional

If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/)."

title string
optional

A name for the key.

Responses

application/json Deploy Key object

Response

Headers
Location string

Example: https://api.github.com/repos/octocat/Hello-World/keys/1

created_at string
required
id integer
required
key string
required
read_only boolean
required
title string
required
url string
required
verified boolean
required
application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required