/v1/workspaces/{workspace_id}/smtp-config/verifyAuthTest arbitrary SMTP creds without persisting
Path parameters
workspace_id*string · uuidId of the workspace.
Request body
host*stringSMTP server hostname.
Example: "smtp.sendgrid.net"
port*numberSMTP server port (commonly 587 for STARTTLS, 465 for implicit TLS).
Example: 587
secure*booleanWhether to use implicit TLS (true → port 465 style). For STARTTLS on 587, set false.
Example: false
usernamestringSMTP username. May be omitted alongside password for anonymous SMTP (e.g. postfix on a private network); otherwise both are required.
passwordstringSMTP password. Stored encrypted at rest; never returned by GET endpoints.
from_name*stringDefault From name on outbound messages.
Example: "Acme Notifications"
from_email*string · emailDefault From email address. Must be authorized to send on the chosen domain.
Example: "noreply@acme.com"
Response · 200
ok*booleanTrue when the server accepted the connection and login.
errorobjectThe failure; absent when `ok` is true.
Example
Request
POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/smtp-config/verify
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"host": "smtp.sendgrid.net",
"port": 587,
"secure": false,
"username": "string",
"password": "string",
"from_name": "Acme Notifications",
"from_email": "noreply@acme.com"
}import { Mail } from "@productcraft/mail";
// Reads PRODUCTCRAFT_API_KEY from the environment
const mail = new Mail();
const smtpVerifyResult = await mail.smtpConfig.verify({
from_email: "noreply@acme.com",
from_name: "Acme Notifications",
host: "smtp.sendgrid.net",
port: 587,
secure: false,
});mail.smtpConfig.verify(params, options?): Mail.SmtpVerifyResult
Response
{
"ok": false,
"error": {}
}