Save email settings
PUT
/api/v1/instance/email
const url = 'https://example.com/api/v1/instance/email';const options = { method: 'PUT', headers: { cookie: 'ttx_access_token=<ttx_access_token>', 'X-CSRF-Token': '<X-CSRF-Token>', 'Content-Type': 'application/json' }, body: '{"enabled":true,"from_address":"example","from_name":"example","reply_to":"example","smtp_host":"example","smtp_password":"example","smtp_port":587,"smtp_security":"starttls","smtp_username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/instance/email \ --header 'Content-Type: application/json' \ --header 'X-CSRF-Token: <X-CSRF-Token>' \ --cookie ttx_access_token=<ttx_access_token> \ --data '{ "enabled": true, "from_address": "example", "from_name": "example", "reply_to": "example", "smtp_host": "example", "smtp_password": "example", "smtp_port": 587, "smtp_security": "starttls", "smtp_username": "example" }'Recorded (without the password), with step-up: whoever controls the mail server reads every message the deployment sends.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
EmailSettingsUpdateRequest
object
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
EmailSettingsRead
Platform -> Email. Never carries a secret: has_password says
whether one is stored, password_readable whether the current key
still decrypts it.
object
active
required
Active
boolean
allow_insecure
required
Allow Insecure
boolean
configured
required
Configured
boolean
enabled
Enabled
boolean
failed
Failed
integer
has_password
Has Password
boolean
password_readable
Password Readable
boolean
pending
Pending
integer
pinned_by_env
required
Pinned By Env
boolean
Example
{ "enabled": false, "failed": 0, "has_password": false, "password_readable": true, "pending": 0, "smtp_security": "starttls"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}