Search + K

Command Palette

Search for a command to run...

Sign In

Create a deploy key

POST /repos/{owner}/{repo}/keys
Copy endpoint
https://api.github.com

You can create a read-only deploy key.

Parameters

path Path Parameters

Name Type
owner required

The account owner of the repository. The name is not case sensitive.

string
repo required

The name of the repository without the .git extension. The name is not case sensitive.

string

Request Body

application/json required
{ title?: string;key: string;read_only?: boolean; }

Responses

201 application/json

Response

interface DeployKey {
id: number;
key: string;
url: string;
title: string;
verified: boolean;
created_at: string;
read_only: boolean;
added_by?: string | null;
last_used?: string | null;
enabled?: boolean;
}

Client Errors

422 application/json

Validation failed, or the endpoint has been spammed.

interface ValidationError {
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}
[]
;
}