Gamers Mail

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.

text
https://gamersmail.com/api/v1

Authentication

Every request must include two headers. Both are required - a request missing either header returns 401 Unauthorized.

HeaderDescriptionExample
X-API-KeyYour public API keygm_live_abc123...
X-API-TokenYour secret tokengmt_live_xyz789...
bash
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

1

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.

2

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.

3

Add Headers to Every Request

Include both headers in every API call:

bash
curl https://gamersmail.com/api/v1/inbox \
 -H "X-API-Key: YOUR_API_KEY" \
 -H "X-API-Token: YOUR_API_TOKEN"
javascript
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();
python
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

  1. Request API access in Settings → API and describe your automation use case.
  2. Admin approves your key with accounts:manage (unlimited account creation).
  3. Store X-API-Key and X-API-Token in environment variables.
  4. Create a temp email → use it on a website → read inbox → extract code → delete account.
python
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

bash
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.

ScopePermission
mail:readRead inbox, sent, starred, scheduled emails
mail:sendSend emails to other users
mail:manageMark read/unread, star, move to trash
mail:deletePermanently delete emails
templates:readList and read email templates
templates:writeCreate and delete email templates
filters:readList email filters
filters:writeCreate and delete email filters
user:readRead account profile information
accounts:manageCreate, list, read inbox of, and delete email accounts (automation)

Rate Limits

PlanRequests / minuteEmails / day (send)
Free3050
Pro120500
Business3002,000
Enterprise1,000Unlimited

Error Codes

All errors return JSON with error and message fields.

json
{
 "error": "Unauthorized",
 "message": "Missing X-API-Key header"
}
HTTP StatusError CodeMeaning
400ValidationErrorRequest body/params invalid
401UnauthorizedMissing or invalid API key/token
403ForbiddenScope not granted for this action
404NotFoundResource not found
409ConflictResource already exists
429RateLimitedToo many requests
500InternalErrorServer-side error
503ServiceUnavailablePayment/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.

python
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