In order to access Rails APIs, developers need to set up their API keys first. This can be done through our website UI.

Add a new API key

First go to the API Key Management tab under Settings. On this page, you will see the existing keys you already have and the Create API Key button.

API key setup: step 1

Click on the Create API Key button and you should see the Create API Key page below. Next, enter a name for the key you are going to add and click on the Create API Key button.

API key setup: step 2

The newly created API key comes with two parts: the key and the secret. The API key is an identifier like your username while the secret is similar to your password, which you should keep to yourself. Remember to copy your secret and store it in a safe place before clicking on the API key created successfully button.

API key setup: step 3

Now the newly created key should appear in the table. Note that under the ACTIONS column, there is a “trash can” icon you can click on to revoke an existing key.

API key setup: step 4

Revoke an existing API key

In case an existing API key is compromised or you want to rotate the key after a certain period, you can click on the “trash can” icon to revoke it.

API key setup: step 5

After the key is revoked, you can create a new key following the same steps above.

Use an API key

API keys (including both the key and the secret) are used to exchange for a short-lived access token which we can use to access Rails APIs. For details, go check out the token endpoint under Authorization. Just remember to access your API secrets securely (e.g., access them via environment variables). Never check your secrets into a code repository.