Skip to content

Create SMTP credential

Request

Create a new named SMTP credential with a generated username and password.

The plain-text password is returned only once in the response. Store it securely. It cannot be retrieved again — use the rotate endpoint to generate a new one.

Optionally restrict the credential to a specific verified sending domain. If set, emails sent using this credential must use that domain in the From header or they will be rejected by the SMTP server.

Hostname binding: Set smtp_hostname_id to bind this credential to a specific custom SMTP hostname. When bound, the credential can only be used to authenticate via that hostname. A master credential (is_master: true) can authenticate via any hostname. See Custom SMTP Hostnames.

Security
ApiKeyAuth
Bodyapplication/jsonrequired
namestringrequired

Friendly name for this credential

Example:"Production Transactional"
sending_domain_idstring or null, (uuid)

Optional. Restrict this credential to a specific verified sending domain.

smtp_hostname_idstring or null, (uuid)

Optional. Bind this credential to a specific custom SMTP hostname (from /api/v1/smtp-credentials/hostnames). When set, this credential can only be used to authenticate via that hostname. Credentials without a hostname binding can only be used via the default smtp.mailerlogic.net endpoint (unless is_master is true).

daily_limitinteger

Optional. Maximum emails per day for this credential.

Example:5000
monthly_limitinteger

Optional. Maximum emails per month for this credential.

Example:100000
curl -i -X POST \
  https://api.mailerlogic.net/api/v1/smtp-credentials \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "name": "Production Transactional",
    "sending_domain_id": "4dc1df09-f07f-4cc2-9e75-1240084fe120",
    "smtp_hostname_id": "cbe51af0-9ef7-4e65-8ec4-7ca3e8ba26e2",
    "daily_limit": 5000,
    "monthly_limit": 100000
  }'

Responses

Credential created — save the password now, it will not be shown again

Bodyapplication/json
credentialobject(SMTPCredential)
plain_passwordstring

The generated password. Shown once only.

Example:"smtp_a1b2c3d4e5f6789..."
Response
{ "credential": { "id": "550e8400-e29b-41d4-a716-446655440001", "name": "Production Transactional", "username": "ml_smtp_1f2961f48a99c8e2", "status": "active", "is_master": false, "sending_domain": null, "daily_limit": 5000, "monthly_limit": 100000, "daily_sent": 0, "monthly_sent": 0 }, "plain_password": "smtp_a1b2c3d4e5f6789abcdef..." }