Test the confirmation email

POST /api/v1/settings/optin/test-send Sends the confirmation email to an address of your choice, with a link that confirms nobody. Admin role required.
A test is a real send. It goes through the same guards as a campaign and counts against your sending quota. It writes no statistic.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Request body

FieldTypeRequiredDescription
emailstringyesWhere to deliver the test
subjectstringnoTry a subject without saving it
contentstringnoTry an HTML body without saving it

Example

bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}' \
  "https://www.agentsmail.io/api/v1/settings/optin/test-send"

Response

  • 200 OK — the call succeeded.
  • 400 Bad Request — validation failed; details carries the field-level issues.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 403 Forbidden — the key's owner is a member of the organization, not an admin.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

Refusal statuses: blocked (sending paused across AgentsMail), not_allowed (organization not cleared, or domain not verified), skipped (nothing to send).
FieldTypeDescription
successbooleanIndicates if the operation was successful
data.statusstringsent, or the reason it did not go out

Example response

json
{"success": true, "data": {"status": "sent"}}