REST API · v1
API overview
Base path: /api/v1 on the same host as your Mailofly app. All resource routes require a valid API key unless noted. Full endpoint detail lives on each resource page in this section.
Discovery
GET /api/v1 returns JSON describing available resources. No authentication.
Request
GET https://your-deployment.example/api/v1
Accept: application/jsonAuthentication
Header: Authorization: Bearer <key>. Keys use the mf_live_ prefix. Create keys in the app: API keys.
Example header
Authorization: Bearer mf_live_…- 401 when the key is missing, invalid, or expired.
- Server needs
SUPABASE_SERVICE_ROLE_KEYto validate keys.
Responses & errors
Successful reads typically return { "data": … }. Creates return 201 with data. Errors return 4xx/5xx with JSON such as:
{
"error": "Unauthorized",
"message": "Invalid API key"
}Resources
- Accounts — sending identities (SMTP / Google)
- Segments — audiences
- Segment contacts — membership in a segment
- Contacts — people and custom fields
- Templates — subject + HTML body
- Campaigns, runs & send
- Compose — one-off send (manual or contacts)
- Mail logs — delivery rows
Concept guides