Hello user,
The iubenda Consent Database provides two different API keys: a public one and a private one.
A public API key is a code that is meant to be shared with the public. It is used to access publicly available data or services provided by the API. For example, if you wanted to access weather data from a weather API, you would need to use a public API key to authenticate your request. In our case, you can use it only for saving consents. You can't use it to access the data stored in the database or modify them (in that case you'll need the private one).
On the other hand, a private API key is a code that is meant to be kept secret. It is used to access data or services that are not meant to be publicly available.
For example, if you were building a mobile app that uses a payment API, you would need to use a private API key to authenticate your requests, since the payment data is sensitive and should not be publicly accessible.
Regarding iubenda, our private key can give you access to all your consents stored in the database, and you can also modify some specific sections of your consents, legal_notices, but in this case, the private key is not accessible in the HTML because you will use it with a backend language.
In summary, a public API key is used for accessing publicly available data or services, while a private API key is used for accessing data or services that are not meant to be publicly available and should be kept secure.
Anyway, if you want to completely avoid sharing the public API key, you can consider creating a backend integration with our Consent Database, using the private API key, as explained here: https://www.iubenda.com/en/help/6484-consent-solution-http-api-documentation
I also want to remind you that, if needed, you can regenerate your API keys from the “EMBED” section of the Consent Database → “Javascript” column.
Do not hesitate to contact me for further help.