Generate API Key

To generate a new API key, use the following request:

POST /users/:id/user_api_keys/generate.xml
POST /users/:id/user_api_keys/generate.json

XML Request Example

curl -u 'user@email:user_api_key' --request POST 'http://onapp.test/users/2/user_api_keys/generate.xml'

JSON Request Example

curl -u 'user@email:user_api_key' --request POST 'http://onapp.test/users/2/user_api_keys/generate.json'

XML Output Example



api_key - API key created for a user

We do not store the API keys for security reasons. This is the only time you can see the key.

There is a limit of 100 API keys per user. To increase the limit: 

  1. Open file /onapp/interface/config/info_hub.yml
  2. Add parameter api.max_keys and set an appropriate value for API keys limit