API Documentation

RESTful API for programmatic access to msgs.global

Base URL: https://msgs.global/api/v1 Authentication: JWT Bearer Token

Authentication

All API requests require authentication using JWT tokens.

POST
/auth/api/token
{
  "email": "user@example.com",
  "password": "your-password"
}

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_at": "2026-02-17T15:23:45Z"
}

Include the token in all subsequent requests:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Email Aliases

List Aliases

GET
/aliases
{
  "aliases": [
    {
      "id": "uuid-here",
      "alias_email": "alias@msgs.global",
      "forward_to": "you@gmail.com",
      "enabled": true,
      "created_at": "2026-01-15T10:30:00Z"
    }
  ],
  "count": 1
}

Create Alias

POST
/aliases
{
  "alias_email": "myalias@msgs.global",
  "forward_to": "destination@example.com"
}

Update Alias

PUT
/aliases/:id
{
  "enabled": false,
  "forward_to": "newemail@example.com"
}

Delete Alias

DELETE
/aliases/:id

Custom Domains

Add Domain

POST
/domains
{
  "domain": "mydomain.com"
}

Response includes verification token:

{
  "domain_id": "uuid-here",
  "domain": "mydomain.com",
  "verification_token": "verify-token-123",
  "txt_record": "_msgs-verify.mydomain.com",
  "instructions": "Add TXT record with verification token"
}

Verify Domain

GET
/auth/verify-domain?domain_id=xxx

Email Logs

List Email Logs

GET
/emails?limit=50
{
  "emails": [
    {
      "id": "uuid",
      "from_email": "sender@example.com",
      "to_email": "alias@msgs.global",
      "subject": "Email subject",
      "verdict": "clean",
      "spam_score": 2.5,
      "phishing_score": 0.1,
      "processed_at": "2026-02-16T14:30:00Z"
    }
  ]
}

Quarantine Management

List Quarantined Emails

GET
/admin/quarantine?limit=50

Release from Quarantine

POST
/admin/quarantine/:id/release
{
  "action": "release"
}

Admin API

Admin endpoints require @afterdarksys.com email

Platform Statistics

GET
/admin/stats

Pending Approvals

GET
/admin/pending-approvals

Approve Domain

POST
/admin/approve/domain/:id
{
  "approved": true
}

Webhooks

Configure webhooks to receive real-time notifications

Email Received

{
  "event": "email.received",
  "timestamp": "2026-02-16T14:30:00Z",
  "data": {
    "alias_id": "uuid",
    "from": "sender@example.com",
    "verdict": "clean"
  }
}

Email Quarantined

{
  "event": "email.quarantined",
  "timestamp": "2026-02-16T14:30:00Z",
  "data": {
    "alias_id": "uuid",
    "from": "sender@example.com",
    "reason": "high_spam_score"
  }
}

Error Codes

Code Message Description
400 Bad Request Invalid request format or parameters
401 Unauthorized Missing or invalid authentication token
403 Forbidden Insufficient permissions for this resource
404 Not Found Resource does not exist
429 Rate Limited Too many requests, slow down
500 Internal Error Server error, please try again

Need Help?

Contact our developer support team for assistance

Contact Support