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 organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | yes | Where to deliver the test |
subject | string | no | Try a subject without saving it |
content | string | no | Try 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;detailscarries the field-level issues.401 Unauthorized— missing or invalid key, or its owner left the organization.403 Forbidden— the key's owner is amemberof the organization, not anadmin.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).
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.status | string | sent, or the reason it did not go out |
Example response
json
{"success": true, "data": {"status": "sent"}}