- Overview
- Reference Guide
- Setup & Architecture
- Release Notes
- Workflow
- API Reference
- Integration Guide
- Discovery Agent Setup Guide
SMTP
The SMTP endpoints read and update the SMTP configuration used to send email notifications, and send a test email.
For the corresponding user interface, refer to the Miscellaneous > Service Setup section.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /smtp | Get SMTP config. |
| POST | /smtp | Update SMTP config. |
| POST | /test_smtp | Test SMTP. |
GET /smtp
Returns the SMTP configuration. The password is not returned.
Example Request
curl -X GET "https://<certsecure-backend-url>/smtp" \
-H "Authorization: Bearer <token>"
Example Response
{
"email": "[email protected]",
"host": "smtp.example.com",
"port": "25",
"use_tls": false
}
Responses
| Status Code | Description |
|---|---|
| 200 | The configuration is returned. |
POST /smtp
Updates the SMTP configuration used to send email notifications.
Request Body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
port |
integer | No | - |
Example Request
curl -X POST "https://<certsecure-backend-url>/smtp" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"port": 1}'
Responses
| Status Code | Description |
|---|---|
| 200 | The settings were saved. |
POST /test_smtp
Sends a test email with the SMTP configuration.
Request Body (application/json)
The request body is a JSON object that contains the settings to save.
Example Request
curl -X POST "https://<certsecure-backend-url>/test_smtp" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}'
Responses
| Status Code | Description |
|---|---|
| 200 | Test mail sent. |
| 400 | SMTP error. |