Set email inbox

Sets the email inbox for your server.

Requires the user to havemanage-email-inboxpermission.

Payload

Example Payload

{
    "name": "new email",
    "email": "mdyemaasil@rocket.chat",
    "active": false,
    "description": "This email has been set",
    "senderInfo": "email sender",
    "department": "awesome department",
    "smtp": {
        "password": "10fae4dc374fb87d",
        "port": 25,
        "secure": true,
        "server": "smtp.mailtrap.io",
        "username": "b5ef5safd6cb806c"
    },
    "imap": {
        "password": "10fae4374sdfb87d",
        "port": 993,
        "secure": true,
        "server": "imap.mailtrap.io",
        "username": "b5ef5aafd6cb806c"
    }
}

Example Call

curl -L -X POST 'http://localhost:3000/api/v1/email-inbox' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92' \
-H 'Content-Type: application/json' \
--data-raw '{
    "_id": "JdVkn_dkOlms_",
    "name": "my_new_email",
    "email": "myinboxemail@rocket.chat",
    "active": false,
    "smtp": {
        "password": "10fae4dc374fb87d",
        "port": 25,
        "secure": true,
        "server": "smtp.mailtrap.io",
        "username": "b5ef5safd6cb806c"
    },
    "imap": {
        "password": "10fae4374sdfb87d",
        "port": 993,
        "secure": true,
        "server": "imap.mailtrap.io",
        "username": "b5ef5aafd6cb806c"
    }
}'

Result

Success

{
    "_id": "JdVkn_dkOlms_",
    "success": true
}

Errors

The following error can occur upon the endpoint.

  • Authorization: Requires an authentication token for the request to be made.

  • Permission: Requires the user to have manage-email-inbox permission for the request to be made.

  • Duplicate: You get a duplicate error when the email you are trying to set is already in record.

{
    "success": false,
    "error": "unauthorized"
}

Change Log

Last updated

Rocket.Chat versions receive support for six months after release.