Update SMTP configuration
curl --request PUT \
--url https://api.example.com/api/auth/smtp-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"host": "<string>",
"username": "<string>",
"password": "<string>",
"senderEmail": "jsmith@example.com",
"senderName": "<string>",
"minIntervalSeconds": 60
}
'import requests
url = "https://api.example.com/api/auth/smtp-config"
payload = {
"enabled": True,
"host": "<string>",
"username": "<string>",
"password": "<string>",
"senderEmail": "jsmith@example.com",
"senderName": "<string>",
"minIntervalSeconds": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
host: '<string>',
username: '<string>',
password: '<string>',
senderEmail: 'jsmith@example.com',
senderName: '<string>',
minIntervalSeconds: 60
})
};
fetch('https://api.example.com/api/auth/smtp-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/auth/smtp-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'host' => '<string>',
'username' => '<string>',
'password' => '<string>',
'senderEmail' => 'jsmith@example.com',
'senderName' => '<string>',
'minIntervalSeconds' => 60
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/auth/smtp-config"
payload := strings.NewReader("{\n \"enabled\": true,\n \"host\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"senderEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"minIntervalSeconds\": 60\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/auth/smtp-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"host\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"senderEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"minIntervalSeconds\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/smtp-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"host\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"senderEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"minIntervalSeconds\": 60\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"host": "<string>",
"port": 123,
"username": "<string>",
"hasPassword": true,
"senderEmail": "jsmith@example.com",
"senderName": "<string>",
"minIntervalSeconds": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Admin
Update SMTP configuration
Create or update SMTP email configuration (admin only).
When enabled is true, the fields host, username, senderEmail, and senderName are required by the backend validation.
When enabled is false, these fields may be empty.
SMTP cannot be disabled on a self-hosted instance while email verification is required, unless a managed email provider is available.
PUT
/
api
/
auth
/
smtp-config
Update SMTP configuration
curl --request PUT \
--url https://api.example.com/api/auth/smtp-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"host": "<string>",
"username": "<string>",
"password": "<string>",
"senderEmail": "jsmith@example.com",
"senderName": "<string>",
"minIntervalSeconds": 60
}
'import requests
url = "https://api.example.com/api/auth/smtp-config"
payload = {
"enabled": True,
"host": "<string>",
"username": "<string>",
"password": "<string>",
"senderEmail": "jsmith@example.com",
"senderName": "<string>",
"minIntervalSeconds": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
host: '<string>',
username: '<string>',
password: '<string>',
senderEmail: 'jsmith@example.com',
senderName: '<string>',
minIntervalSeconds: 60
})
};
fetch('https://api.example.com/api/auth/smtp-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/auth/smtp-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'host' => '<string>',
'username' => '<string>',
'password' => '<string>',
'senderEmail' => 'jsmith@example.com',
'senderName' => '<string>',
'minIntervalSeconds' => 60
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/auth/smtp-config"
payload := strings.NewReader("{\n \"enabled\": true,\n \"host\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"senderEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"minIntervalSeconds\": 60\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/auth/smtp-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"host\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"senderEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"minIntervalSeconds\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/smtp-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"host\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"senderEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"minIntervalSeconds\": 60\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"host": "<string>",
"port": 123,
"username": "<string>",
"hasPassword": true,
"senderEmail": "jsmith@example.com",
"senderName": "<string>",
"minIntervalSeconds": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
Body
application/json
Response
SMTP configuration updated
Was this page helpful?