Create a deploy key
POST
/repos/{owner}/{repo}/keys 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 | 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;
}
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;
}[];
}
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}[];
}