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

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

Organisation context

string
The unique identifier (UUID) of the organisation. Do not send it — it is filled in automatically from your API key.
Organisation-scoped endpoints do need organisation context, but your API key already carries it: the API sets the header from the key before any permission check runs. Any value you send is overwritten, so the header can never be used to reach a different organisation. To work with a second organisation, create a key in that organisation.

Endpoints that need no project header

A handful of endpoints are not project-scoped:

Missing or mismatched headers

Header problems return 403, not 400:

Best Practices

Store IDs in environment variables for easy management across environments:
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.