Several courts have ruled that APIs are copyrightable. I don't have my casebook handy but I believe there was an Apple case a few decades ago where this was affirmed at the appellate level.
But by-and-large the copyrightability of APIs is still an open question, I believe.
I personally think APIs (and many, many other things) shouldn't be copyrightability. But my "beliefs" count for squat. And the problem in the FOSS community is that we hear a certain cadre of academics swear up and down that APIs aren't copyrightable, and we believe them because they're the only voices we hear.
Well, unfortunately, there are other voices. Rich voices. And those voices pay for conferences and retreats for judges and other policymakers. And though to our ears those voices sound weak and distant, that simply might say more about how far away from the legal mainstream our community is than it does about where the actual law is actually headed. Though, I tend to think most district courts aren't eager to join the party happening over in the patent circuit, and seem to be holding the line against strengthening of copyrights wrt IT.
Still, there's quite a long list of sharp turns the law has taken which surprised the vast majority of legal scholars.