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-organisation-id

x-organisation-id
string
required
The unique identifier (UUID) of your organisation. This header is required for all API requests.
The organisation ID determines:
  • Which organisation’s resources you can access
  • Billing and credit consumption
  • User permissions context
Format: UUID v7 (e.g., 01234567-89ab-cdef-0123-456789abcdef)

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 v7 (e.g., fedcba98-7654-3210-fedc-ba9876543210)

Finding Your IDs

Organisation ID

You can find your organisation ID from the dashboard:
  1. Go to app.mentionlab.io
  2. Navigate to Organisation SettingsGeneral
  3. Your Organisation ID is displayed on this page
The organisation ID is only available through the dashboard. There is no API endpoint to retrieve it.

Project ID

You can find 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..." \
  -H "x-organisation-id: YOUR_ORG_ID"

Best Practices

Store IDs in environment variables for easy management across environments:
# .env
MENTIONLAB_ORG_ID=01234567-89ab-cdef-0123-456789abcdef
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