Integrator reference

Email Gateway API

Send transactional email with an API token. Use sender emails and template names — never enumerate internal IDs.

Getting started

Introduction

REST API under /v1. Integrators authenticate with an opaque API token. Identities and templates are configured in the admin dashboard — tokens cannot list them.

Base URL: https://gateway.tag.mw/v1

Getting started

Authentication

Request header
Authorization: Bearer eg_xxxxxxxxxxxxxxxxxxxxxxxx
ScopeBehavior
ALL_IDENTITIESSend as any verified identity (pass from).
SINGLE_IDENTITYBound identity only. You may omit from.
MULTI_IDENTITYOnly listed identities; from required and must be in scope.

What your token can call

POST /v1/messages, POST /v1/messages/extended, GET /v1/messages* (your sends), and /v1/webhooks* (your endpoints). No identity or template listing.

Getting started

Rate limiting

Global limit default 300/minute; tokens may set rate_limit_per_minute. Over limit → 429 RATE_LIMITED.

Conventions

Lists & pagination

Response shape
{
  "data": [ /* … */ ],
  "pagination": {
    "total": 0,
    "page": 1,
    "page_size": 50,
    "has_more": false
  }
}

Conventions

Errors

Example
{
  "code": "VALIDATION_ERROR",
  "message": "subject is required",
  "request_id": "a1b2c3d4"
}

Conventions

Idempotency

Pass Idempotency-Key on send. Same body → original response; different body → 409 IDEMPOTENCY_CONFLICT.

Endpoints

Health

GET/v1/healthPublic
GET/v1/readyPublic

Endpoints

Messages

POST/v1/messagesAPI token

Use from (sender email) and optional template (unique name). With SINGLE_IDENTITY tokens, omit from.

POST /v1/messages
curl -X POST https://gateway.tag.mw/v1/messages \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "no-reply@example.com",
    "to": ["user@example.com"],
    "subject": "Hello",
    "text": "Plain body"
  }'

Extended / bulk template send

POST/v1/messages/extendedAPI token
Body
{
  "from": "billing@example.com",
  "template": "invoice-ready",
  "messages": [
    { "email": "a@example.com", "variables": { "name": "Alice" } }
  ]
}

No numeric IDs required

Pass the template name from the dashboard. Do not call list endpoints to discover ids — those routes are admin-only.

List & detail

GET/v1/messagesAPI token
GET/v1/messages/{id}API token

Tokens only see messages they created.

Endpoints

Webhooks

POST/v1/webhooksAPI token
GET/v1/webhooksAPI token
POST/v1/webhooks/{id}/rotate-secretAPI token
DELETE/v1/webhooks/{id}API token

Signing header X-Signature: sha256=…. Secret returned once; stored encrypted at rest.