Skip to main content

Overview

In addition to API key authentication, MentionLab uses context headers to scope API requests to specific organisations and projects. These headers ensure you’re working with the correct data and have appropriate access.

Required Headers

x-project-id

x-project-id
string
The unique identifier (UUID) of the project. Required for project-scoped operations.
The project ID determines:
  • Which project’s queries, tags, and results you access
  • Project-specific settings and configurations
Format: UUID (e.g., fedcba98-7654-3210-fedc-ba9876543210)

Finding Your Project ID

From the Dashboard:
  1. Go to app.mentionlab.io
  2. Open your project and navigate to Project SettingsGeneral
  3. Your Project ID is displayed on this page
From the API: List your projects to retrieve their IDs
curl -X GET "https://api.mentionlab.io/api/projects" \
  -H "x-api-key: ml_live_abc123xyz789..."

Best Practices

Store IDs in environment variables for easy management across environments:
# .env
MENTIONLAB_PROJECT_ID=fedcba98-7654-3210-fedc-ba9876543210
Build a wrapper that automatically includes the required headers to avoid repetition and errors.
If you work with multiple projects, pass the project ID as a parameter rather than hardcoding it.

Next Steps

REST API Getting Started

Review base URL, JSON requirements, and rate limits.

Rate Limits

Understand API rate limits and best practices.