Create a public SSH key for the authenticated user
Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/[email protected]/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).
POST
/user/keys- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Body Params
requiredapplication/jsonobject
key string
requiredThe public SSH key to add to your GitHub account.
title string
optionalA descriptive name for the new key.
Example: Personal MacBook Air
Responses
application/json Key object
Response
created_at string<date-time>
requiredid integer
requiredkey string
requiredread_only boolean
requiredtitle string
requiredurl string
requiredverified boolean
requiredNot modified
application/json Basic Error object
Requires authentication
documentation_url string
optionalmessage string
optionalstatus string
optionalurl string
optionalapplication/json Basic Error object
Forbidden
documentation_url string
optionalmessage string
optionalstatus string
optionalurl string
optionalapplication/json Basic Error object
Resource not found
documentation_url string
optionalmessage string
optionalstatus string
optionalurl string
optionalapplication/json Validation Error object
Validation failed
documentation_url string
required errors array[object]optional
errors array[object]
optional items object
items object
code string
requiredfield string
optionalindex integer
optionalmessage string
optionalresource string
optionalvalue
optionalmessage string
required