Test a Mail account connection
POST
/api/v1/mail/accounts/test
const url = 'https://example.com/api/v1/mail/accounts/test';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"app_password":"example","email":"example","imap_host":"example","imap_port":1,"imap_tls_mode":"implicit","provider":"gmail","smtp_app_password":"example","smtp_host":"example","smtp_port":1,"smtp_tls_mode":"implicit","smtp_username":"example","username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/mail/accounts/test \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "app_password": "example", "email": "example", "imap_host": "example", "imap_port": 1, "imap_tls_mode": "implicit", "provider": "gmail", "smtp_app_password": "example", "smtp_host": "example", "smtp_port": 1, "smtp_tls_mode": "implicit", "smtp_username": "example", "username": "example" }'Requires a signed-in User. It checks the IMAP settings and credentials without saving an account. It returns 400 for invalid settings, or a provider error when the connection check fails. Route: /api/v1/mail/accounts/test. Inputs: . Do not automatically replay this operation after an uncertain result.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
app_password
required
string
email
required
string
imap_host
required
string
imap_port
required
integer format: int32
imap_tls_mode
required
IMAP transport mode. Cleartext authentication is never allowed.
string
provider
required
string
smtp_app_password
string | null
smtp_host
required
string
smtp_port
required
integer format: int32
smtp_tls_mode
required
IMAP transport mode. Cleartext authentication is never allowed.
string
smtp_username
required
string
username
required
string
Responses
Section titled “Responses”Media typeapplication/json
object
imap_authenticated
required
boolean
selectable_folder_count
required
integer
Examplegenerated
{ "imap_authenticated": true, "selectable_folder_count": 1}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}