Update sign-up settings

PATCH /api/v1/settings/optin Double opt-in and the confirmation email. Admin role required. The setting is a floor an API call cannot lower: a script may ask for double opt-in when the organization does not require it, never skip it when it does.

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
requiredbooleannotrue creates new contacts as pending until they confirm
subjectstringnoSubject of the confirmation email
contentstringnoIts HTML — rejected without {{confirmationUrl}}

Example

bash
curl -X PATCH -H "x-api-key: $AGENTMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"required": true}' \
  "https://www.agentsmail.io/api/v1/settings/optin"

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

Content identical to the default is stored as empty, so the organization keeps inheriting future improvements to it. That is what customized tells you.
FieldTypeDescription
successbooleanIndicates if the operation was successful
data.requiredbooleanWhether confirmation is now demanded
data.subjectstringThe subject in force
data.contentstringThe HTML in force
data.customizedbooleanfalse means both are still the product defaults

Example response

json
{
  "success": true,
  "data": {"required": true, "subject": "Confirm your subscription", "content": "<html>…{{confirmationUrl}}…</html>", "customized": true}
}