Skip to main content

Getting Your API Key

Your API key is used to authenticate all requests to the MentionLab API.
1

Sign in to MentionLab

Go to app.mentionlab.io and sign in to your account.
2

Navigate to Settings

Click on your profile or organization settings in the dashboard.
3

Generate API Key

In the API section, click “Generate API Key” to create a new key.
4

Copy and Store Securely

Copy your API key immediately. For security reasons, you won’t be able to see it again.
Your API key is only shown once when generated. Store it securely in a password manager or environment variable. If you lose it, you’ll need to generate a new one.

API Key Format

MentionLab API keys use the following format:
ml_live_abc123xyz789def456...
API keys always start with ml_live_ for production keys or ml_test_ for test environment keys.

Using Your API Key

Include your API key in the x-api-key header of every request:
x-api-key: ml_live_abc123xyz789def456...

Example

curl -X GET "https://api.mentionlab.io/api/projects" \
  -H "x-api-key: ml_live_abc123xyz789..." \
  -H "x-organisation-id: YOUR_ORGANISATION_ID"

Managing API Keys

Multiple Keys

For different environments or applications, consider using separate API keys:
EnvironmentKey Purpose
DevelopmentTesting and development
StagingPre-production testing
ProductionLive application

Environment Variables

We recommend storing your API key in environment variables:
  • Unix/Linux/macOS
  • Windows
  • .env file
# Add to ~/.bashrc, ~/.zshrc, or similar
export MENTIONLAB_API_KEY="your-api-key-here"
Always add .env files to your .gitignore to prevent accidentally committing secrets to version control.

Next Steps

Context Headers

Learn about the x-organisation-id and x-project-id headers required for API requests.