Gamers Mail API
Everything you need to send mail, read inboxes, manage templates and filters, and create accounts programmatically from your own tools.
Introduction
REST API
Standard HTTP JSON endpoints
Secure Auth
Two-header key authentication
Scope Control
Fine-grained permission scopes
The Gamers Mail API lets you programmatically access your inbox, send emails, and with the accounts:manage inbox - send and read emails, manage templates, set filters, and more.
All API calls go to the base URL below. All responses are JSON.
https://gamersmail.com/api/v1
Authentication
Every request must include two headers. Both are required - a request missing either header returns 401 Unauthorized.
| Header | Description | Example |
|---|---|---|
| X-API-Key | Your public API key | gm_live_abc123... |
| X-API-Token | Your secret token | gmt_live_xyz789... |
curl https://gamersmail.com/api/v1/inbox \ -H "X-API-Key: gm_live_YOUR_KEY_HERE" \ -H "X-API-Token: gmt_live_YOUR_TOKEN_HERE"
Getting Started
Request API Access
Go to Settings → API tab in your Gamers Mail account. Describe your intended use case and submit a request. Admin will review and approve it with the appropriate scopes.
Copy Your Credentials
Once approved, your API Key and API Token will appear in Settings → API. Copy both - the token is only shown once. Store them in environment variables, never in source code.
Add Headers to Every Request
Include both headers in every API call:
curl https://gamersmail.com/api/v1/inbox \ -H "X-API-Key: YOUR_API_KEY" \ -H "X-API-Token: YOUR_API_TOKEN"
const response = await fetch("https://gamersmail.com/api/v1/inbox", {
headers: {
"X-API-Key": process.env.GAMERMAIL_API_KEY,
"X-API-Token": process.env.GAMERMAIL_API_TOKEN,
},
});
const data = await response.json();import requests
headers = {
"X-API-Key": "YOUR_API_KEY",
"X-API-Token": "YOUR_API_TOKEN",
}
res = requests.get("https://gamersmail.com/api/v1/inbox", headers=headers)
emails = res.json()Python Automation Guide
Create emails & read verification codes
Admin grants you API access with the accounts:manage scope. Then your Python script can create unlimited disposable inboxes, wait for OTP/verification emails, extract codes, and clean up.
Step-by-step workflow
- Request API access in Settings → API and describe your automation use case.
- Admin approves your key with
accounts:manage(unlimited account creation). - Store
X-API-KeyandX-API-Tokenin environment variables. - Create a temp email → use it on a website → read inbox → extract code → delete account.
import os
import re
import requests
BASE = "https://gamersmail.com/api/v1"
HEADERS = {
"X-API-Key": os.environ["GAMERMAIL_API_KEY"],
"X-API-Token": os.environ["GAMERMAIL_API_TOKEN"],
"Content-Type": "application/json",
}
def create_temp_email():
"""Create a disposable inbox. Username is optional, and auto-generated if omitted."""
r = requests.post(f"{BASE}/accounts", json={}, headers=HEADERS, timeout=30)
r.raise_for_status()
data = r.json()
print(f"Created: {data['email']}")
return data["id"], data["email"]
def wait_for_email(account_id, subject_contains="", from_contains="", timeout=90):
"""Server-side poll that waits until a matching email arrives."""
params = {
"timeout": timeout,
"interval": 3,
"subjectContains": subject_contains,
"fromContains": from_contains,
}
r = requests.get(
f"{BASE}/accounts/{account_id}/wait-for-email",
headers=HEADERS,
params=params,
timeout=timeout + 15,
)
if r.status_code == 408:
return None
r.raise_for_status()
return r.json()["email"]
def extract_verification_code(text):
"""Pull a 4-8 digit OTP from email subject/body."""
match = re.search(r"\b(\d{4,8})\b", text)
return match.group(1) if match else None
def read_inbox(account_id):
r = requests.get(f"{BASE}/accounts/{account_id}/inbox", headers=HEADERS, timeout=30)
r.raise_for_status()
return r.json()["emails"]
def delete_account(account_id):
requests.delete(f"{BASE}/accounts/{account_id}", headers=HEADERS, timeout=30)
# --- Example: sign-up automation ---
account_id, email = create_temp_email()
print(f"Use this email on the target site: {email}")
# Option A: server waits for you (recommended)
msg = wait_for_email(account_id, subject_contains="verify", timeout=120)
if msg:
code = extract_verification_code(msg["subject"] + " " + msg.get("body", ""))
print(f"Verification code: {code}")
else:
# Option B: manual poll
for mail in read_inbox(account_id):
code = extract_verification_code(mail["subject"] + " " + mail.get("body", ""))
if code:
print(f"Verification code: {code}")
break
delete_account(account_id)
print("Done. Account removed.")Install & run
pip install requests export GAMERMAIL_API_KEY="gm_live_..." export GAMERMAIL_API_TOKEN="gmt_live_..." python your_script.py
Approved API keys with accounts:manage can create extra accounts for your own automation, up to your plan limit. Only accounts created by your API key can be read or deleted.
Scopes & Rate Limits
Available Scopes
Each API key is granted specific scopes. Calling an endpoint without the required scope returns 403 Forbidden.
| Scope | Permission |
|---|---|
| mail:read | Read inbox, sent, starred, scheduled emails |
| mail:send | Send emails to other users |
| mail:manage | Mark read/unread, star, move to trash |
| mail:delete | Permanently delete emails |
| templates:read | List and read email templates |
| templates:write | Create and delete email templates |
| filters:read | List email filters |
| filters:write | Create and delete email filters |
| user:read | Read account profile information |
| accounts:manage | Create, list, read inbox of, and delete email accounts (automation) |
Rate Limits
| Plan | Requests / minute | Emails / day (send) |
|---|---|---|
| Free | 30 | 50 |
| Pro | 120 | 500 |
| Business | 300 | 2,000 |
| Enterprise | 1,000 | Unlimited |
Error Codes
All errors return JSON with error and message fields.
{
"error": "Unauthorized",
"message": "Missing X-API-Key header"
}| HTTP Status | Error Code | Meaning |
|---|---|---|
| 400 | ValidationError | Request body/params invalid |
| 401 | Unauthorized | Missing or invalid API key/token |
| 403 | Forbidden | Scope not granted for this action |
| 404 | NotFound | Resource not found |
| 409 | Conflict | Resource already exists |
| 429 | RateLimited | Too many requests |
| 500 | InternalError | Server-side error |
| 503 | ServiceUnavailable | Payment/external service unavailable |
Account Creation (Automation)
Built for automation scripts
Use this API to create disposable @gamersmail.com email accounts on demand - perfect for automation, testing, or any workflow where you need a fresh inbox instantly. Requires the accounts:manage scope (granted by admin). No limit on how many accounts you create.
Automation Script Example
Full script: create account → wait for email → read it → delete account.
import requests, re, os
BASE = "https://gamersmail.com/api/v1"
HEADERS = {
"X-API-Key": "YOUR_API_KEY",
"X-API-Token": "YOUR_API_TOKEN",
"Content-Type": "application/json",
}
# 1. Create a fresh email (username auto-generated)
r = requests.post(f"{BASE}/accounts", json={}, headers=HEADERS)
account = r.json()
print(f"Created: {account['email']} password: {account['password']}")
account_id = account["id"]
# 2. Wait for an email to arrive (poll every 5 seconds, up to 2 minutes)
email = None
for _ in range(24):
time.sleep(5)
inbox = requests.get(f"{BASE}/accounts/{account_id}/inbox", headers=HEADERS).json()
if inbox["emails"]:
email = inbox["emails"][0]
print(f"Got email: {email['subject']}")
break
# 3. Use the email content
if email:
print(f"Body: {email['body'][:200]}")
# 4. Clean up - delete the account
requests.delete(f"{BASE}/accounts/{account_id}", headers=HEADERS)
print("Account deleted.")Mail Endpoints
All mail endpoints require the appropriate mail:* scope.
Email Templates
Save reusable email drafts as templates.
Email Filters
Automate actions on incoming emails using filters.
User / Account
Need help? Contact us at [email protected] · Back to Gamers Mail · Free Tools
Translate