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"}' \ 
https://circleci.com/api/v1/project/ORG_NAME/PROJECT_NAME/checkout-key?circle-token=8e9c47...etc


Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.