Documentation For agents
Use the command line
Any shell or script can call the Mailglo HTTP API with an agent's token or your own. The OpenAPI description at /api/openapi.json lists every operation with its fields, and the API guide explains permissions and errors.
Configure it
Set two environment variables in the agent's environment or secret store:
export MAILGLO_URL=https://mailglo.example
export MAILGLO_TOKEN=<the token from Agents>
MAILGLO_URL is the address of your Mailglo workspace, without a path.
Confirm the connection
curl -s -H "Authorization: Bearer $MAILGLO_TOKEN" "$MAILGLO_URL/api/v1/msps/<id>/discovery"
The answer lists your permissions, limits and the workflow entry points. Your account ID is shown under Team & sharing, Sharing.
Everyday calls
GET /api/v1/msps/<id>/portfoliolists work waiting on someone.GET /api/v1/msps/<id>/cases/<caseId>/packetreturns what an investigation knows.POST /api/v1/msps/<id>/domains/<domainId>/planswith the body{"kind":"dmarc","purpose":"..."}and anIdempotency-Keyheader prepares a change; nothing is published.
Output and errors
Responses are JSON. Every error has a category, a retry value and a next_step. Lists return one page and say whether more exist.
Rotating the token
Rotate from Agents; the old token stops working at once. Update MAILGLO_TOKEN wherever the agent runs.
Documentation version docs-2026-10-12.
Found an error, or a question this page does not answer? Email support@mailglo.com.