Skip to main content

Working with the API

All Truvity Cloud API operations require authentication to return information or make changes to your wallet. You can authenticate your requests by adding a created API key.


To authenticate requests, you must pass the API key retrieved from the Admin Panel as an X-API-KEY header.

The configuration may differ depending on how you work with the API. For example, to configure an bash environment with an API key in a scheme with direct communication to the Truvity Cloud API:

# add environment variable exporting to your bash profile (~/.bash_profile)

# make requests with curl using the exported environment variable
curl --request POST \
--url "" \
--header "X-API-KEY: ${TRUVITY_API_KEY}"

Security considerations

Remember that you should pay close attention to who has access to your API keys. If someone is able to retrieve them, they will have the ability to read any information from your wallets and even make changes on your behalf.

It's okay to use API keys directly in frontend applications when building prototypes or in a secured environment. However, consider avoiding using API keys on the frontend if you plan to deploy your application to the public.

The easiest way to secure your API keys is to use a so-called "API proxy", which is essentially a reverse proxy managed by you that accepts requests from your application and redirects them to the Truvity Cloud API by adding necessary headers that are managed on your side and accessible only by you.