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
The unique identifier (UUID) of your organisation. This header is required for all API requests.
- Which organisation’s resources you can access
- Billing and credit consumption
- User permissions context
01234567-89ab-cdef-0123-456789abcdef)
x-project-id
The unique identifier (UUID) of the project. Required for project-scoped operations.
- Which project’s queries, tags, and results you access
- Project-specific settings and configurations
fedcba98-7654-3210-fedc-ba9876543210)
Finding Your IDs
Organisation ID
You can find your organisation ID from the dashboard:- Go to app.mentionlab.io
- Navigate to Organisation Settings → General
- 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:- Go to app.mentionlab.io
- Open your project and navigate to Project Settings → General
- Your Project ID is displayed on this page
Best Practices
Use environment variables
Use environment variables
Store IDs in environment variables for easy management across environments:
Create a centralized API client
Create a centralized API client
Build a wrapper that automatically includes the required headers to avoid repetition and errors.
Handle multiple projects
Handle multiple projects
If you work with multiple projects, pass the project ID as a parameter rather than hardcoding it.