Create User Keys with the API

User keys can be configured to checkout additional repositories needed for testing. For repos with a large number of projects, it may be easier to assign User Keys via the API than configuring this on the individual project settings page. 

To do this, CircleCI first needs permissions from GitHub to add SSH keys to your account. You can grant this permission by visiting Project Settings > Permissions > Checkout SSH keys and clicking on Create and Add User Key.

After you authorize the CircleCI application, you can use our API to add a checkout key of type github-user-key for any of your other projects using the curl command:

curl -X POST \ 
--header "Content-Type: application/json" \ 
-d '{"type":"github-user-key"}' \
Was this article helpful?
2 out of 7 found this helpful



Please sign in to leave a comment.