Skip to main content

Base URL

All API requests use this base URL.

Authentication

Include your API key in the Authorization header:
  • Secret Key (sk_*) — Required for all endpoints except /v1/track
  • Public Key (pk_*) — Only works with /v1/track for client-side event tracking
Each API key set in the dashboard includes both a pk_* and sk_* key. You can create multiple key sets per workspace and scope them to specific domains.
Domain-scoped keys are enforced on sender-domain operations (for example /v1/send and SMTP sends). If a key is scoped, the sender domain must be in that key’s allowlist.
For key management details (create, edit scope, revoke), see API Keys.

Making requests

Send transactional email

Track event

Create contact

Response format

Response shapes differ by endpoint family.

Public API endpoints (/v1/*)

Public endpoints return a wrapped response:

Dashboard API endpoints

Dashboard endpoints usually return raw resource objects. Example (GET /contacts/{id}):
Campaign action endpoints (for example POST /campaigns, GET /campaigns/{id}) return wrapped payloads with success and data.

Error response

All errors include detailed information to help you debug issues:
Error fields:
  • code — Machine-readable error code for programmatic handling
  • message — Human-readable description
  • statusCode — HTTP status code
  • requestId — Unique ID for debugging (include when contacting support)
  • errors — Field-level validation details (when applicable)
  • suggestion — Helpful guidance for fixing the error
See the Error Codes documentation for complete details and examples.

Pagination

The API uses two pagination styles, depending on endpoint:

Cursor-based pagination (contacts)

Parameters:
  • limit — Number of items per page (default: 20, max: 100)
  • cursor — Pagination cursor from previous response

Page-based pagination (campaigns, templates, workflow executions, segment contacts)

Parameters:
  • page — Page number (default: 1)
  • pageSize — Items per page (default: 20, max: 100)

Rate limits

MailGlyph enforces reasonable rate limits to ensure service quality:
  • Email sending — 14 emails/second (default)
  • API requests — 1000 requests/minute per workspace
  • Bulk operations — Automatically queued for processing
If you exceed limits, you’ll receive a 429 Too Many Requests response.

Error codes

The API uses standard HTTP status codes along with machine-readable error codes: 400 Bad Request — Invalid request parameters or malformed request body 401 Unauthorized — Missing or invalid API key 403 Forbidden — Not authorized to access this resource or workspace disabled 404 Not Found — Resource doesn’t exist 422 Unprocessable Entity — Request validation failed (see errors array for details) 429 Too Many Requests — Rate limit exceeded 500 Internal Server Error — An unexpected error occurred (contact support with request ID) For a complete list of error codes and troubleshooting guidance, see the Error Codes documentation.

Client libraries

Node.js

See Node.js SDK docs.

Go

See Go SDK docs.

Python

See Python SDK docs.

PHP

See PHP SDK docs.

cURL

What’s next