Skip to main content

Admin API: SMTP

Operations on smtp in the Odudu admin API, one section each. Every request carries a bearer token; the index says which audience it needs and how a refusal is shaped.

GET /admin/tenants/{tenant}/smtp​

Requires the "manage-tenant" capability.

effective names whose relay the tenant’s mail goes through: tenant for its own, deployment for the deployment’s ODUDU_SMTP_* sender, none when mail is only logged.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
configuredbooleanyesWhether the tenant has a relay of its own saved.
hoststring or nullyesThe relay’s host, or null when the tenant has none.
portinteger or nullyesThe relay’s port, or null when the tenant has none.
from_addressstring or nullyesWhat the From line of each message says, or null when the tenant has no relay.
usernamestring or nullyesThe login the relay asks for, or null when it asks for none.
password_setbooleanyesWhether a password is stored. The password itself is never returned, whether the relay was just written or read in an earlier session.
starttlsboolean or nullyesWhether the connection must upgrade to TLS (STARTTLS), or null when the tenant has no relay.
effectivestringyesConstraints: one of tenant, deployment, none.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

PUT /admin/tenants/{tenant}/smtp​

Requires the "manage-tenant" capability.

Replaces the whole configuration except the password, which GET never hands back to resend: omitting password keeps the stored one, and null clears it. A kept password stays with the relay it was entered for: omitting it while host, port or username changes is refused with 400 naming password. Answers an ETag, as GET does; If-Match is optional, and a stale one is refused with 412.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Request body​

Body: application/json

FieldTypeRequiredDetails
hoststringyesThe relay’s host. Constraints: at least 1 character.
portintegeryesThe relay’s port, a whole number from 1 to 65535. Constraints: at least 1, at most 65535.
from_addressstringyesWhat the From line of each message says. Constraints: at least 1 character.
usernamestring or nullnoThe login the relay asks for. Omit it or send null when it asks for none. Constraints: at least 1 character.
passwordstring or nullnoThe password to store. Omitted, the stored one is kept while the host, port and username are unchanged; null clears it. Constraints: at least 1 character.
starttlsbooleannoWhether the connection must upgrade to TLS (STARTTLS). Required while a username or password is set.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
configuredbooleanyesWhether the tenant has a relay of its own saved.
hoststring or nullyesThe relay’s host, or null when the tenant has none.
portinteger or nullyesThe relay’s port, or null when the tenant has none.
from_addressstring or nullyesWhat the From line of each message says, or null when the tenant has no relay.
usernamestring or nullyesThe login the relay asks for, or null when it asks for none.
password_setbooleanyesWhether a password is stored. The password itself is never returned, whether the relay was just written or read in an earlier session.
starttlsboolean or nullyesWhether the connection must upgrade to TLS (STARTTLS), or null when the tenant has no relay.
effectivestringyesConstraints: one of tenant, deployment, none.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

DELETE /admin/tenants/{tenant}/smtp​

Requires the "manage-tenant" capability.

Removes the tenant’s own relay, sending its mail back to the deployment’s own sender. 404 when the tenant has no SMTP configuration.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Responses​

204 OK​

Body: application/json

FieldTypeRequiredDetails
(body)anyyes

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

POST /admin/tenants/{tenant}/smtp/test​

Requires the "manage-tenant" capability.

Sends one message synchronously and reports the transport’s own failure as a 502, rather than the tenant discovering a bad configuration only when a user’s verification mail silently fails. 400 when the tenant has no SMTP configuration.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Request body​

Body: application/json

FieldTypeRequiredDetails
tostringyesThe address to send the test message to. Constraints: at least 1 character.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
sentbooleanyesTrue when the relay accepted the message. A relay that refuses it answers 502 instead.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

Documentation coverage: 22 of 24 fields described (91%).