menu
Update a mail server
Updates an email server configuration. The full configuration including the password is required - the credentials are validated as a set against the SMTP server before saving - and the password is never echoed back.
Endpoint
PATCH https://api.sendstreak.com/v2/accounts/{accountId}/mail-servers/{mailServerId}
All v2 endpoints require a bearer token - see Authentication.
Path parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The account the request is scoped to. |
mailServerId | string |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | no | |
serviceType | string | yes | Provider preset the server was configured from, e.g. awsses, gmail, or postmark. |
host | string | yes | SMTP host, e.g. email-smtp.eu-west-1.amazonaws.com for AWS SES. |
port | integer | yes | SMTP port - typically 587 (STARTTLS) or 465 (implicit TLS). |
secure | boolean | yes | Connect with implicit TLS (typically port 465). |
requireTLS | boolean | yes | Require a STARTTLS upgrade on plaintext connections (typically port 587). |
user | string | yes | SMTP username. |
password | string | yes | SMTP password. Write-only: required on create and update, masked on every read. |
Response
The updated mail server (credentials masked).
{
"_id": "665f0a2b1c9d440012ab34cd",
"serviceType": "awsses",
"host": "smtp.example.com",
"port": 587,
"secure": false,
"requireTLS": false,
"user": "smtp-user",
"password": ""
}
Errors
| Status | Description |
|---|---|
400 | The request body or parameters failed validation. |
401 | Missing or invalid token, or the token is not authorized for this account/user. |
See Errors and rate limits for what error responses look like.
Curl example
curl --location --request PATCH 'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/mail-servers/YOUR_MAIL_SERVER_ID' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"_id": "665f0a2b1c9d440012ab34cd",
"serviceType": "awsses",
"host": "smtp.example.com",
"port": 587,
"secure": false,
"requireTLS": false,
"user": "smtp-user",
"password": "super-secret-password"
}'