Skip to main content

/o/email_test

Endpoint

/o/email_test

Overview

Sends a test email to the authenticated global admin user's email address to verify current mail delivery setup.

This endpoint is configuration-dependent: the Countly instance must have a working mail transport configured. On instances without SMTP/sendmail transport, the request can authenticate successfully but still return 503 Failed.

Authentication

Countly API supports three authentication methods:

  1. API Key (parameter): api_key=YOUR_API_KEY
  2. Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  3. Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Required permission: Global Admin.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.

Configuration Impact

SettingDefaultAffectsUser-visible impact
config.mail.transportnodemailer-smtp-transport fallback behaviorProcessing flowMail transport selection controls whether test email can be sent.
config.mail.configServer configurationProcessing flowSMTP/sendmail connection settings determine success or failure of test delivery.
white-labeling.emailFrom / white-labeling.emailCompanyEmptyMessage metadataIf configured, affects sender identity used by outbound email module.

Response

Success Response

{
"result": "OK"
}

Response Fields

FieldTypeDescription
resultStringOK when send operation succeeds.

Error Responses

503 Service Unavailable

{
"result": "Failed"
}

400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

400 Bad Request

{
"result": "Token not valid"
}

401 Unauthorized

{
"result": "User does not exist"
}

401 Unauthorized

{
"result": "User does not have right"
}

401 Unauthorized

{
"result": "User is locked"
}

401 Unauthorized

{
"result": "Token is invalid"
}

Behavior/Processing

  • Validates global-admin access.
  • Uses authenticated member email as recipient.
  • Builds subject/body from localization file when available for the member language.
  • Sends mail through configured server mail transport.
  • Returns 503 Failed when the mail module cannot deliver through the configured transport.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersGlobal-admin validation and recipient lookupReads authenticated user's account and email address.

Examples

Send test email

/o/email_test?api_key=YOUR_API_KEY

Limitations

  • Recipient address is always the authenticated admin user's email.
  • The endpoint validates send attempt, not mailbox delivery/open status.
  • Requires an operational mail transport on the target Countly server.

Last Updated

2026-04-13