SMTP Users
Get a list of SMTP users
Retrieve information about account SMTP users with this GET
request:
GET https://api.mailersend.com/v1/domains/{domain_id}/smtp-users
Request parameters
URL parameter | Type | Required | Limitations | Details |
---|
domain_id | string | yes | | |
Query Parameter | Type | Required | Limitations | Details |
---|
limit | int | no | Min: 10 , Max: 100 | Default: 25 |
Responses
Valid
Response Code: 200 OK
Response Headers:
content-type: application/json
{
"data": [
{
"id": "0wkg2zj19ovx5py7",
"name": "Support SMTP",
"username": "MS_bGQ0nV@mailerlite.com",
"password": "W3XCfDM6NWs69puR",
"enabled": true,
"accessed_at": null,
"server": "127.0.0.1",
"port": 465,
"domain_id": "7nxe3yjmeq28vp0k",
}
]
}
Error
Response Code: 404 Not Found
Get a single SMTP user
If you want to retrieve a single account SMTP user, use this GET
request:
GET https://api.mailersend.com/v1/domains/{domain_id}/smtp-users/{smtp_user_id}
Request parameters
URL parameter | Type | Required | Limitations | Details |
---|
domain_id | string | yes | | |
smtp_user_id | string | yes | | |
Responses
Valid
Response Code: 200 OK
Response Headers:
content-type: application/json
{
"data": {
"id": "0wkg2zj19ovx5py7",
"name": "Support SMTP",
"username": "MS_bGQ0nV@mailerlite.com",
"password": "W3XCfDM6NWs69puR",
"enabled": true,
"accessed_at": null,
"server": "127.0.0.1",
"port": 465,
"domain_id": "7nxe3yjmeq28vp0k"
}
}
Error
Response Code: 404 Not Found
Add SMTP user
If you want to add a SMTP user to your domain, use this POST
request:
POST https://api.mailersend.com/v1/domains/{domain_id}/smtp-users
Request parameters
URL parameter | Type | Required | Limitations | Details |
---|
domain_id | string | yes | | |
Request Parameters
JSON parameters are provided in dot notation
JSON Parameter | Type | Required | Limitations | Details |
---|
name | string | yes | Max 50 characters | |
enabled | boolean | no | | |
Responses
Response Key | Type | Details |
---|
data | object | SMTP user object created. |
Valid
Response Code: 201 CREATED
Response Headers:
content-type: application/json
{
"data": {
"id": "480xl1qpeorzeg65",
"name": "Support",
"username": "MS_8PerdM@mailerlite.com",
"password": "87GoZePLsPEKiGZR",
"enabled": true,
"accessed_at": null,
"server": "127.0.0.1",
"port": 465,
"domain_id": "7nxe3yjmeq28vp0k"
}
}
Invalid
Response Code: 422 Unprocessable Entity
See - Validation errors
Update SMTP user
If you want to update the information of an existing SMTP user, use this PUT
request:
PUT https://api.mailersend.com/v1/domains/{domain_id}/smtp-users/{smtp_user_id}
Request Parameters
URL parameter | Type | Required | Limitations | Details |
---|
domain_id | string | yes | | |
smtp_user_id | string | yes | | |
JSON parameters are provided in dot notation
JSON Parameter | Type | Required | Limitations | Details |
---|
name | string | yes | Max 50 characters | |
enabled | boolean | no | | |
Responses
Response Key | Type | Details |
---|
data | object | SMTP user object updated. |
Valid
Response Code: 200 OK
Response Headers:
content-type: application/json
{
"data": {
"id": "0z76k5jg0o3yeg2d",
"name": "Support SMTP",
"username": "MS_9sjABw@testing.com",
"password": "ByeSJgB7Wc6tTm4a",
"enabled": false,
"accessed_at": null,
"server": "127.0.0.1",
"port": 465,
"domain_id": "04mknvjymj87xp62"
}
}
Invalid
Response Code: 422 Unprocessable Entity
See - Validation errors
Delete SMTP user
If you want to remove SMTP user, use this DELETE
request:
DELETE https://api.mailersend.com/v1/domains/{domain_id}/smtp-users/{smtp_user_id}
Request parameters
URL parameter | Type | Required | Limitations | Details |
---|
domain_id | string | yes | | |
smtp_user_id | string | yes | | |
Responses
Valid
Error
Response Code: 404 Not Found