Skip to main content

ssh_signing_keys

Creates, updates, deletes, gets or lists a ssh_signing_keys resource.

Overview

Namessh_signing_keys
TypeResource
Idgithub.users.ssh_signing_keys

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
created_atstring (date-time)
keystring
titlestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ssh_signing_key_for_authenticated_userselectssh_signing_key_idGets extended details for an SSH signing key.

OAuth app tokens and personal access tokens (classic) need the read:ssh_signing_key scope to use this endpoint.
list_ssh_signing_keys_for_userselectusernameper_page, pageLists the SSH signing keys for a user. This operation is accessible by anyone.
list_ssh_signing_keys_for_authenticated_userselectper_page, pageLists the SSH signing keys for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the read:ssh_signing_key scope to use this endpoint.
create_ssh_signing_key_for_authenticated_userinsertkeyCreates an SSH signing key for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the write:ssh_signing_key scope to use this endpoint.
delete_ssh_signing_key_for_authenticated_userdeletessh_signing_key_idDeletes an SSH signing key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the admin:ssh_signing_key scope to use this endpoint.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ssh_signing_key_idintegerThe unique identifier of the SSH signing key.
usernamestringThe handle for the GitHub user account.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Gets extended details for an SSH signing key.

OAuth app tokens and personal access tokens (classic) need the read:ssh_signing_key scope to use this endpoint.

SELECT
id,
created_at,
key,
title
FROM github.users.ssh_signing_keys
WHERE ssh_signing_key_id = '{{ ssh_signing_key_id }}' -- required
;

INSERT examples

Creates an SSH signing key for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the write:ssh_signing_key scope to use this endpoint.

INSERT INTO github.users.ssh_signing_keys (
title,
key
)
SELECT
'{{ title }}',
'{{ key }}' /* required */
RETURNING
id,
created_at,
key,
title
;

DELETE examples

Deletes an SSH signing key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the admin:ssh_signing_key scope to use this endpoint.

DELETE FROM github.users.ssh_signing_keys
WHERE ssh_signing_key_id = '{{ ssh_signing_key_id }}' --required
;