Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:10:29+00:00 2026-05-25T14:10:29+00:00

I am following the guidelines published here: http://develop.github.com/p/repo.html I am trying to add a

  • 0

I am following the guidelines published here: http://develop.github.com/p/repo.html

I am trying to add a public key to my set of deploy keys, using the GitHub API.

Creating the repo works fine:

curl -F "login=username" -F "token=ApiToken" https://github.com/api/v2/json/repos/create -F name=myrepo

{"repository":{"owner":"username","has_downloads":true,"forks":1,"url":"https://github.com/username/myrepo","watchers":1,"has_wiki":true,"fork":false,"size":0,"open_issues":0,"created_at":"2011/09/06 02:42:08 -0700","name":"myrepo","private":false,"has_issues":true}}

I can list the keys (emtpy for now):

curl -F "login=username" -F "token=ApiToken" https://github.com/api/v2/json/repos/keys/username/myrepo

{"public_keys":[]}

But I can not add keys (stays empty even after addition!):

curl -X POST -F "login=username" -F "token=ApiToken" https://github.com/api/v2/json/repos/key/username/myrepo/add -F "title=TheTitle" -F "key=ssh-rsa xxxxx..."

{"public_keys":[]}

Is there any limitation to the GitHub API, regarding key addition?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:10:30+00:00Added an answer on May 25, 2026 at 2:10 pm

    I found the problem, so for reference here it is.
    Github does not allow a public key to be associated to several users.
    If you try to add the key using the web interface, you will get the following message:

    Oops! The key has already been taken.
    

    The API is silent. That is why I was confused.

    Using a brand new key, the API works as expected and replies with:

    curl -X POST -F "login=username" -F "token=ApiToken" https://github.com/api/v2/json/repos/key/username/myrepo/add -F "title=Bogus" -F "key=ssh-rsa xxxxx...."
    
    {"public_keys":[{"title":"Bogus","id":1199679,"key":"ssh-rsa xxxx..."}]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Aloha, I've been following the guidelines here: http://developer.android.com/resources/tutorials/testing/helloandroid_test.html To create some simple test cases
I added TextToSpeech to my app, following the guidelines in the following post: http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html
I am following the guidelines from http://blogs.msdn.com/b/webdevtools/archive/2009/10/29/converting-a-web-site-project-to-a-web-application-project.aspx Mid way through the process they have
I have a WCF web service with tracing enabled (following these guidelines http://msdn.microsoft.com/en-us/library/aa702726.aspx ).
Consider the following method, public void Add(Enum key, object value); Since Enum is a
I'm trying to implement a remember me feature, following the guidelines provided here: The
Here http://source.android.com/source/code-style.html#follow-field-naming-conventions it is stated that : Field Names Non-public, non-static field names start
I am trying to write a plugin, following the guidelines from jQuery site. I
I am trying to find only new tweets using Twitter Search. For example: http://search.twitter.com/search?tag=bruins&lang=en&rpp=100&result_type=recent&since=22451745267388417
According to [MSDN: Array usage guidelines]( http://msdn.microsoft.com/en-us/library/k2604h5s(VS.71).aspx) : Array Valued Properties You should use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.