I've done it - no harm whatsoever. Don't let it go through the dry cycle. Air dry it.
What kind of keyboard was it?
I've gone for 10 years without a mishap up until I replaced my keyboard last July. I bought a new wireless with a mouse and almost immediately spilled coffee into it. When I bought my new computer after Christmas it came with a wireless keyboard and I've now managed to spill both Sprite and coffee (cream and sugar) into it.
The keys still work but some of them want to stick. I don't want to do anything to it that would ruin it since it is still working.