Authentication
Create an API key in the app and send it as a bearer token on every request.
Every request to the MailGraf API carries an API key. Keys belong to your account and are created in the app, not through the API.
Create a key
Open Settings > API keys
Keys are managed under API keys in the app settings.Create a key and copy it
Click Create API key, give the key a name you will recognise later and copy it. The full key is shown only once. Store it in your server configuration or secret manager.Keep it server side
Never put the key in browser code or a public repository. If it leaks, revoke it and create a new one.
Send it as a bearer token
Add an Authorization header to every request:
Authorization: Bearer mg_live_...
A revoked key stops working immediately. After repeated failed attempts from one IP address, access from that address is locked for a while, so fix the key rather than retrying.
Rate limits
Each key has a request limit per minute. Above it the API responds with 429 and a Retry-After header. Wait that many seconds before sending again.
Where the full reference lives
Every endpoint, its parameters, response schemas and error codes are documented in the API reference. These guides do not repeat them, so the two cannot drift apart.
Frequently asked questions
I lost my key. Can I see it again?
No. A key is shown once, when it is created. Create a new key and revoke the old one.
What happens when I revoke a key?
Requests with that key stop working immediately.
Is there a rate limit?
Yes. Above the limit the API answers with 429 and a Retry-After header that tells you how many seconds to wait.
Was this helpful?
Still need help?
Write to us and a person will answer.

