Skip to main content

Overview

All MentionLab REST API requests require an API key sent in the x-api-key header. Your API key is scoped to a single organization and can access all projects within that organization.
Project-scoped API keys are on the roadmap.

Get Your API Key

You can retrieve your API key from the dashboard:
1

Sign in to MentionLab

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

Open API Keys

Use the organization switcher in the top bar, choose Organization settings, then Developer settings → API Keys in the sidebar.
3

Create the key

Click Create API Key and set a Name, a Permission (Read only or Read & Write) and an optional Expiration Date — leave it empty for a key that never expires.
4

Copy and store securely

Copy your API key immediately. For security reasons, you will not be able to see it again.
Only organization Administrators can create or delete keys. Editors can see the list.

Permissions

Read & Write is not full access. It cannot delete projects, manage members, or change organization settings and billing — those actions return 403 regardless of the key.
Your API key is only shown once when generated. Store it securely in a password manager or environment variable. If you lose it, you will need to generate a new one.

API Key Format

MentionLab API keys use the following format:
API keys always start with ml_live_ for production keys.

Using Your API Key

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

Example

GET /api/v1/projects needs no project header, so it’s the natural first call to verify a key and discover your project IDs.

Environment Variables

We recommend storing your API key in environment variables:
Always add .env files to your .gitignore to prevent accidentally committing secrets to version control.

Required Headers

Example Request

Most list endpoints are POST, with filters and paging in the body:

Project Context

Project-specific endpoints require the x-project-id header so the API knows which project to operate on. You can store a default project ID in your environment if most requests target a single project.
A missing or invalid context header returns 403, not 400 — for example Missing project id context or Project does not belong to specified organisation.

Invalid keys

Rate Limits

The MentionLab API implements rate limiting to ensure fair usage and maintain service stability for all users. Understanding these limits helps you design efficient integrations that avoid throttling.

Default Rate Limits

All accounts share the same default rate limits:
If you have a custom agreement with MentionLab, your rate limits may differ from the defaults listed here. Please refer to your agreement documentation for your specific limits.

Rate Limit Headers

Every API response includes headers to help you track your usage:

Handling Rate Limits

When you exceed the rate limit, the API returns a 429 Too Many Requests response:

Error Codes

Next Steps

Context Headers

See all header requirements and examples.

REST API Getting Started

Review base URL, JSON requirements, and rate limits.