{
"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"
}
}
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"
}
}'
{
"_id": "JdVkn_dkOlms_",
"success": true
}
The following error can occur upon the endpoint.
{
"success": false,
"error": "unauthorized"
}
{
"success": false,
"error": "error-not-allowed"
}
{
"success": false,
"error": "E11000 duplicate key error index: rocketchat.rocketchat_email_inbox.$email_1 dup key: { : \"mdyemail@rocket.chat\" }"
}
{
"success": false,
"error": "error-invalid-email-inbox"
}