Generating User Api Keys with REST API

When I try to make a post with the api documented at http://docs.discourse.org using a user api key, it says

You are not permitted to view the requested resource. The API username or key is invalid.

So I think it’s a different API or needs different fields (client_id?) for authentication.