To interact with the API, you need a valid API key. This key acts as a secure bridge between your technical systems and Leadfeeder’s data, ensuring that only authorized requests are processed.
How to Generate an API Key
Navigate to your settings: Log in to your Leadfeeder account.
Click on the settings ⚙️ in the left-hand navigation bar.
Go to Personal and API keys: In the settings menu on the left, find and click on the "API keys" section under your personal settings.
Create a New API Key: Click the "Create a new API key" button. You will be prompted to give the token a name. After naming it, a new token will be instantly generated. For security reasons, you will only be able to see the full token once, so make sure to copy and store it in a safe place.
Understanding Permissions
The Leadfeeder API is designed to be simple yet secure. Currently, permissions are managed as follows:
User-Based Access: The API key inherits the same permissions as the user who created it. If you have access to three different accounts in the Leadfeeder UI, your API key can also access data for those three accounts.
Mandatory Account ID: To ensure you are pulling data from the correct source, most API requests require an account_id as a mandatory parameter.
Security Best Practices
Your API key is a sensitive credential. If it is compromised, unauthorized parties could access your data. Follow these guidelines to keep your integration secure:
Never Share Keys: Do not share your API key in public forums, support tickets, or unencrypted emails.
Use Environment Variables: Avoid hardcoding your API key directly into your application’s source code. Instead, use environment variables or a secure vault.
Revoke Unused Keys: If a key is no longer needed, or if you suspect it has been leaked, delete it immediately from your settings. Once deleted, the key will stop working instantly.
Technical Setup: We recommend having someone with technical knowledge (such as a developer) handle the initial setup to ensure headers and authentication are configured correctly.
Troubleshooting Authentication Errors
If you receive a 401 Unauthorized error, please check the following:
Header Format: Ensure your key is passed in the x-api-key header.
Missing Parameters: Verify that you have included the required account_id in your request
