Clean Conversations Guide
Clean Conversation will remove all the extra information in email messages. Instead of needing to parse through images, attachments, and HTML pages, our endpoint will remove the information you don’t need and return the information you do.
How Clean Conversation Works
Clean Conversation uses advanced natural language processing and machine learning models to clean-up structured emails.
- Cleaning up structured text
- Using Natural Language preprocessing
- Extracting content with a machine-learning model
- Caching the results to reduce response time
Clean Up a Message
Send a PUT request to /neural/conversation
.
- message_ID - The ID of the message. You can parse up to 20 messages at a time.
Clean Conversation Request
curl --location --request PUT 'https://api.nylas.com/neural/conversation' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message_id": ["10vg4dz96l004qluhp5rk7gbb"]
}'
Clean Conversation Response
The response returns the parsed email message as part of the message object. All of the extra HTML is stripped out leaving just the message content.
- conversation - The cleaned-up email message.
- model_version - Version of the model parsing out the conversation.
[
{
"account_id": "**********",
"bcc": [],
"body": "<div dir=\"ltr\"><div id=\":ar\" class=\"a3s aiL msg4815224842221839925\"><u></u>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n<div style=\"margin-bottom:0;padding-bottom:0;min-width:100%;margin-top:0;margin-right:0;margin-left:0;padding-top:0;padding-right:0;padding-left:0;width:100%\"><div id=\"m_4815224842221839925emailPreHeader\" style=\"opacity:0;color:transparent;line-height:0;font-size:0px;overflow:hidden;border-width:0;display:none!important\">Virtual calendars are now included with Nylas Platform and Calendar subscriptions.</div> \n<div style=\"display:none;white-space:nowrap;font:15px courier;line-height:0\">\n \n</div> \n \n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-spacing:0;border-collapse:collapse\"> \n<tbody> \n<tr> \n<td valign=\"top\" style=\"word-break:break-word;min-width:600px;border-collapse:collapse;background-color:#f2f3f3\"> \n<table width=\"600\" align=\"center\" id=\"m_4815224842221839925boxing\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-spacing:0;border-collapse:collapse\"> \n<tbody> \n<tr> \n<td id=\"m_4815224842221839925template-wrapper\" style=\"word-break:break-word;border-collapse:collapse\">\n<table id=\"m_4815224842221839925free-logo\" style=\"border-spacing:0;border-collapse:collapse\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600 m_4815224842221839925table_header_logo\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto;background:#000\" bgcolor=\"#000000\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" height=\"86\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\"> \n<center> \n<div id=\"m_4815224842221839925singleIMG1\">\n<a href=\"https://email.nylas.com/CSQ00K0mV0NL03BE3O02W06\" target=\"_blank\"> <img class=\"m_4815224842221839925img_header_logo CToWUd\" alt=\"Logo\" style=\"outline:none;border-right-width:0;border-bottom-width:0;border-left-width:0;text-decoration:none;border-top-width:0;display:block;max-width:100%;line-height:100%\" width=\"126\" src=\"https://12qf1516hja245v1v537ieww-wpengine.netdna-ssl.com/wp-content/uploads/2019/08/[email protected]\"> </a>\n</div> \n</center> </td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925free-image1\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#ffffff\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<div id=\"m_4815224842221839925singleIMG2\">\n<a href=\"https://email.nylas.com/x0L0000N3n20V3S0LB6QEWO\" target=\"_blank\"> <img class=\"m_4815224842221839925img_full CToWUd\" alt=\"[email protected]\" style=\"outline:none;border-right-width:0;border-bottom-width:0;border-left-width:0;text-decoration:none;border-top-width:0;display:block;max-width:100%;line-height:100%\" width=\"600\" src=\"https://info.nylas.com/rs/857-LSW-455/images/Virtual_Calendar_NewsletterHero%402x.png\"> </a>\n</div> \n<table class=\"m_4815224842221839925table600\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925free-text\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#ffffff\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600 m_4815224842221839925table_header_content\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;line-height:40px;font-size:40px\" height=\"45px\"></td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;font-family:'Lato',Arial,sans-serif;font-size:14px;line-height:23px;border-collapse:collapse\"> \n<div id=\"m_4815224842221839925text1\">\n<h2 style=\"text-align:center\">Schedule Securely With Virtual Calendars</h2> \n<p style=\"text-align:center\"><span style=\"font-size:11pt;font-family:'Source Sans Pro',sans-serif;color:#000000;background-color:transparent;font-weight:400;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap\">Build flexible, secure scheduling features with just a few lines of code. Virtual Calendars eliminate the need for your users to authenticate with their personal calendars and provide all the seamless scheduling features your users love</span>.<br></p>\n</div> </td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;line-height:40px;font-size:40px\" height=\"30px\"></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925CTA\" style=\"border-spacing:0;border-collapse:collapse\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#ffffff\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n<tr style=\"outline:medium none\"> \n<td style=\"word-break:break-word;border-collapse:collapse\"> \n<center> \n<table style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" align=\"center\" id=\"m_4815224842221839925tableCTAContent1\"><a href=\"https://email.nylas.com/x0L0000N3n20V3S0LB6QEWO\" class=\"m_4815224842221839925primary_button_green\" style=\"background-color:#00e5bf;color:#000000!important;padding:14px 46px!important;width:165px;margin-left:auto;margin-right:auto;text-align:center;box-sizing:border-box;font-size:12px;line-height:12px;display:block;font-weight:bold;font-family:Arial,sans-serif;letter-spacing:0.4px;white-space:nowrap;border:none;text-decoration:none\" target=\"_blank\">READ MORE</a></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n<tr> \n<td class=\"m_4815224842221839925col_cta_content\" style=\"word-break:break-word;border-collapse:collapse;line-height:20px;font-size:20px\" height=\"55px\"></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925free-twoCols\" style=\"border-spacing:0;border-collapse:collapse\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#ffffff\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600 m_4815224842221839925table_twoCols_content\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n<tr> \n<td class=\"m_4815224842221839925col_two_content\" style=\"word-break:break-word;border-collapse:collapse\"> <img alt=\"[email protected]\" style=\"outline:none;border-right-width:0;border-bottom-width:0;border-left-width:0;text-decoration:none;border-top-width:0;display:block;max-width:100%;line-height:100%\" width=\"300\" id=\"m_4815224842221839925imgContent4\" src=\"https://info.nylas.com/rs/857-LSW-455/images/Inbox_Zero_SQ%402x.png\" class=\"CToWUd a6T\" tabindex=\"0\"><div class=\"a6S\" dir=\"ltr\" style=\"opacity:0.01\"><div id=\":cw\" class=\"T-I J-J5-Ji aQv T-I-ax7 L3 a5q\" title=\"Download\" tabindex=\"0\"><div class=\"wkMEBb\"><div class=\"aSK J-J5-Ji aYr\"></div></div></div></div> \n<div id=\"m_4815224842221839925textContent9\" style=\"text-align:center\"> \n<p>Instantly connect 100% of email accounts with Hosted Auth.</p> \n</div> \n<div id=\"m_4815224842221839925tableCTAContent3\"> \n<p><a href=\"https://email.nylas.com/K00O6LS00VNo3MBEQ0230W0\" class=\"m_4815224842221839925primary_button_green\" style=\"background-color:#00e5bf;color:#000000!important;padding:14px 46px!important;width:165px;margin-left:auto;margin-right:auto;text-align:center;box-sizing:border-box;font-size:12px;line-height:12px;display:block;font-weight:bold;font-family:Arial,sans-serif;letter-spacing:0.4px;white-space:nowrap;border:none;text-decoration:none\" target=\"_blank\">READ MORE</a></p> \n</div> </td> \n<td class=\"m_4815224842221839925col_two_content\" style=\"word-break:break-word;border-collapse:collapse\"> <img alt=\"[email protected]\" style=\"outline:none;border-right-width:0;border-bottom-width:0;border-left-width:0;text-decoration:none;border-top-width:0;display:block;max-width:100%;line-height:100%\" width=\"300\" id=\"m_4815224842221839925imgContent5\" src=\"https://info.nylas.com/rs/857-LSW-455/images/Privacy_Shield_Ruling_SQ%402x.png\" class=\"CToWUd a6T\" tabindex=\"0\"><div class=\"a6S\" dir=\"ltr\" style=\"opacity:0.01\"><div id=\":cx\" class=\"T-I J-J5-Ji aQv T-I-ax7 L3 a5q\" title=\"Download\" tabindex=\"0\"><div class=\"wkMEBb\"><div class=\"aSK J-J5-Ji aYr\"></div></div></div></div> \n<div id=\"m_4815224842221839925textContent10\" style=\"text-align:center\"> \n<p>Learn what the recent Privacy Shield Ruling means for your users' data.</p> \n</div> \n<div id=\"m_4815224842221839925tableCTAContent4\"> \n<p><a href=\"https://email.nylas.com/wSEW36BLV0000Q2N00O3p0N\" class=\"m_4815224842221839925primary_button_green\" style=\"background-color:#00e5bf;color:#000000!important;padding:14px 46px!important;width:165px;margin-left:auto;margin-right:auto;text-align:center;box-sizing:border-box;font-size:12px;line-height:12px;display:block;font-weight:bold;font-family:Arial,sans-serif;letter-spacing:0.4px;white-space:nowrap;border:none;text-decoration:none\" target=\"_blank\">READ MORE</a></p> \n</div> </td> \n</tr> \n<tr> \n<td class=\"m_4815224842221839925col_two_postcontent\" style=\"word-break:break-word;border-collapse:collapse;line-height:40px;font-size:40px\" height=\"40px\"></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925prefooter-text\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#ffffff\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600 m_4815224842221839925table_prefooter_content\" style=\"background-color:#000;border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" height=\"35px\"></td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;font-family:'Lato',Arial,sans-serif;font-size:14px;line-height:23px;color:#666;border-collapse:collapse\"> \n<div id=\"m_4815224842221839925prefootertext\" style=\"text-align:center\">\n<p style=\"color:#fff;text-align:center\">Save up to 24 months of development time with the Nylas APIs</p> \n<p> <a style=\"color:#00e5bf;font-weight:bold;text-decoration:none\" href=\"https://email.nylas.com/SS0W3B0EV0603LQ0200QO5E\" target=\"_blank\">Get free API key »</a> </p>\n</div> </td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" height=\"35px\"></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925footer-logos\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#f2f3f3\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" height=\"25px\"></td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;font-family:'Lato',Arial,sans-serif;font-size:14px;line-height:23px;color:#666;border-collapse:collapse\"> \n<div id=\"m_4815224842221839925footerLogos\" style=\"width:210px;margin-left:auto;margin-right:auto\"> \n<a href=\"https://email.nylas.com/c0603OQL0V3S02BWB0EcO00\" style=\"color:#999999\" target=\"_blank\"><img width=\"33px\" style=\"margin-right:20px\" src=\"https://www.nylas.com/wp-content/themes/Avada-Child-Theme/img/[email protected]\" alt=\"Twitter\" class=\"CToWUd\"></a> \n<a href=\"https://email.nylas.com/hVQ2F6S00L000OBQ3030W6E\" style=\"color:#999999\" target=\"_blank\"><img width=\"33px\" style=\"margin-right:20px\" src=\"https://www.nylas.com/wp-content/themes/Avada-Child-Theme/img/[email protected]\" alt=\"Github\" class=\"CToWUd\"></a> \n<a href=\"https://email.nylas.com/m000373060OB2VQESQG0LW0\" style=\"color:#999999\" target=\"_blank\"><img width=\"33px\" style=\"margin-right:20px\" src=\"https://www.nylas.com/wp-content/themes/Avada-Child-Theme/img/[email protected]\" alt=\"Facebook\" class=\"CToWUd\"></a> \n<a href=\"https://email.nylas.com/f00QB0V0EH002S3OL3W8Q06\" style=\"color:#999999\" target=\"_blank\"><img width=\"33px\" src=\"https://www.nylas.com/wp-content/themes/Avada-Child-Theme/img/[email protected]\" alt=\"Linkedin\" class=\"CToWUd\"></a> \n</div> </td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" height=\"30px\"></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table>\n<table id=\"m_4815224842221839925footer\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse;background-color:#f2f3f3\" bgcolor=\"#ffffff\" valign=\"top\"> \n<center> \n<table class=\"m_4815224842221839925table600 m_4815224842221839925table_footer_content\" style=\"border-spacing:0;border-collapse:collapse;margin-top:0;margin-right:auto;margin-bottom:0;margin-left:auto\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"> \n<tbody> \n<tr> \n<td style=\"word-break:break-word;font-family:'Lato',Arial,sans-serif;font-size:14px;line-height:23px;color:#666;border-collapse:collapse\"> \n<div id=\"m_4815224842221839925footerText\">\n<div style=\"text-align:center\"> \n<p>© 2020 Nylas Inc. All rights reserved.</p> \n<p><a style=\"color:#000;text-decoration:underline\" href=\"https://email.nylas.com/M30W0O0ELQ62B009V0QS0I3\" target=\"_blank\">Privacy Policy</a> | <a style=\"color:#000;text-decoration:underline\" href=\"https://email.nylas.com/Y0B6Q0a3Q00OE003VSL0JW2\" target=\"_blank\">Copyright</a> | <a style=\"color:#000;text-decoration:underline\" href=\"https://info.nylas.com/UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=eyJpIjoiTWpoak4yUm1NV1psWVRRMSIsInQiOiJIeUFTbkkycTdyd25GYUFEbDFmYkpZV2VLTGlnZXdJeDZyWmNKVVR4MXMyNndMSmhWMGVEZHNTa0N1TzlqVDE1Y3lTYzZCK3FPQXBaWGkzQUlYa2Q5cjJLbGxzR3ErQUZnb3FJVit2WXEvY1YrSUxpTnJ1U2tOdFd5QUtqdmtYNSJ9\" target=\"_blank\">Unsubscribe</a></p> \n<p>944 Market St, San Francisco, CA 94102</p> \n</div>\n</div> </td> \n</tr> \n<tr> \n<td style=\"word-break:break-word;border-collapse:collapse\" height=\"30px\"></td> \n</tr> \n</tbody> \n</table> \n</center> </td> \n</tr> \n</tbody> \n</table></td> \n</tr> \n</tbody> \n</table> </td> \n</tr> \n</tbody> \n</table> \n \n\n<img src=\"https://email.nylas.com/trk?t=1&mid=ODU3LUxTVy00NTU6MDoxNTAyOjQyNTc6MzY5NDA6MTg2Mjo5OjMzNDA6MTYyNDcwMDpueWxhc3dvcmt0ZXN0KzAxQGdtYWlsLmNvbQ%3D%3D\" width=\"1\" height=\"1\" style=\"display:none!important\" alt=\"\" class=\"CToWUd\"><div class=\"yj6qo\"></div><div class=\"adL\">\n</div></div><div class=\"adL\">\n</div></div><br clear=\"all\"><div><br></div>-- <br><div dir=\"ltr\" class=\"gmail_signature\" data-smartmail=\"gmail_signature\"><div dir=\"ltr\"><br><table style=\"border:none;border-collapse:collapse\"><colgroup><col width=\"84\"><col width=\"540\"></colgroup><tbody><tr style=\"height:79pt\"><td style=\"vertical-align:top;padding:5pt;overflow:hidden\"><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt\"><a href=\"https://www.nylas.com/\" target=\"_blank\"><span style=\"font-size:11pt;font-family:Arial;color:rgb(17,85,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\"><span style=\"border:none;display:inline-block;overflow:hidden;width:70px;height:70px\"><img src=\"https://lh6.googleusercontent.com/zJp7cuIKWhNYHc6KsuHUsfrhyCp9DKxg243bjSLP9JKi9SEX-uMtTAr5qy54Kdlr3RNkTwAEvIDHKBCjodqu8uVLLbReY47_-KtRilUatWsZRRfO2LH9ZTCykLEVBOj8iJ7XmNeX\" width=\"70\" height=\"70\" style=\"margin-left:0px;margin-top:0px\"></span></span></a></p></td><td style=\"vertical-align:top;padding:5pt;overflow:hidden\"><p dir=\"ltr\" style=\"line-height:1.8;margin-top:0pt;margin-bottom:0pt\"><span style=\"font-size:10pt;font-family:"Source Sans Pro",sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap\">Nylas Product Team</span></p><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:0pt\"><span style=\"font-size:8pt;font-family:"Source Sans Pro",sans-serif;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\">Nylas Team, </span><a href=\"https://www.nylas.com/\" target=\"_blank\"><span style=\"font-size:8pt;font-family:"Source Sans Pro",sans-serif;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\">Nylas</span></a></p><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:0pt\"><span style=\"font-size:8pt;font-family:"Source Sans Pro",sans-serif;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\"><a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a></span></p></td></tr><tr style=\"height:63pt\"><td colspan=\"2\" style=\"vertical-align:top;padding:5pt;overflow:hidden\"><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt\"><a href=\"https://www.nylas.com/resources/savings-calculator-integrations/\" target=\"_blank\"><span style=\"font-size:11pt;font-family:Arial;color:rgb(17,85,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\"><span style=\"border:none;display:inline-block;overflow:hidden;width:306px;height:45px\"><img src=\"https://lh3.googleusercontent.com/bTFwY25C4D9lD4GJHxsVEWr8--YG25chLhjDJb3rWpmXPw5RngwZHUWhbDracmaXL7n6mtt5JPM9egiGaFwU2bNKMrvMcctgvrHFOI7YxIzze7CTKKVJRqD8kq2hNUE2IJiPWFmL\" width=\"306\" height=\"45\" style=\"margin-left:0px;margin-top:0px\"></span></span></a></p></td></tr></tbody></table></div></div></div>",
"cc": [],
"conversation": "__\n\nVirtual calendars are now included with Nylas Platform and Calendar\nsubscriptions.\n\n[ \n](https://email.nylas.com/CSQ00K0mV0NL03BE3O02W06) \n\n--- \n\n[\n![[email protected]](https://info.nylas.com/rs/857-LSW-455/images/Virtual_Calendar_NewsletterHero%402x.png)\n](https://email.nylas.com/x0L0000N3n20V3S0LB6QEWO) \n\n--- \n| \n--- \n\nBuild flexible, secure scheduling features with just a few lines of code.\nVirtual Calendars eliminate the need for your users to authenticate with their\npersonal calendars and provide all the seamless scheduling features your users\nlove. \n\n \n| | [READ MORE](https://email.nylas.com/x0L0000N3n20V3S0LB6QEWO) \n--- \n|\n![[email protected]](https://info.nylas.com/rs/857-LSW-455/images/Inbox_Zero_SQ%402x.png)\n\nInstantly connect 100% of email accounts with Hosted Auth.\n\n[READ MORE](https://email.nylas.com/K00O6LS00VNo3MBEQ0230W0)\n\n|\n![[email protected]](https://info.nylas.com/rs/857-LSW-455/images/Privacy_Shield_Ruling_SQ%402x.png)\n\nLearn what the recent Privacy Shield Ruling means for your users' data.\n\n[READ MORE](https://email.nylas.com/wSEW36BLV0000Q2N00O3p0N)",
"date": 1608244442,
"events": [],
"files": [],
"from": [
{
"email": "[email protected]",
"name": "George Washington Carver"
}
],
"id": "**********",
"labels": [
{
"display_name": "Important",
"id": "c2ig7rwrpethf9bqoaq7tnerm",
"name": "important"
},
{
"display_name": "Inbox",
"id": "cgf6uw9mvagi1fibv67kgz7z",
"name": "inbox"
}
],
"model_version": "0.0.1",
"object": "message",
"reply_to": [],
"snippet": "Virtual calendars are now included with Nylas Platform and Calendar subscriptions. Schedule Securely With Virtual Calendars Build flexible, secure scheduling features with just a few lines of code.",
"starred": false,
"subject": "Nylas Virtual Calendars",
"thread_id": "*********",
"to": [
{
"email": "[email protected]",
"name": "Dorothy Vaughan"
}
],
"unread": false
}
]
Comparison of before and after Conversation Request
Comparison of Before and After Clean Conversation Request
After
__\n\nVirtual calendars are now included with Nylas Platform and Calendar\nsubscriptions.\n\n[ \n](https://email.nylas.com/CSQ00K0mV0NL03BE3O02W06) \n\n--- \n\n[\n![[email protected]](https://info.nylas.com/rs/857-LSW-455/images/Virtual_Calendar_NewsletterHero%402x.png)\n](https://email.nylas.com/x0L0000N3n20V3S0LB6QEWO) \n\n--- \n| \n--- \n\nBuild flexible, secure scheduling features with just a few lines of code.\nVirtual Calendars eliminate the need for your users to authenticate with their\npersonal calendars and provide all the seamless scheduling features your users\nlove. \n\n \n| | [READ MORE](https://email.nylas.com/x0L0000N3n20V3S0LB6QEWO) \n--- \n|\n![[email protected]](https://info.nylas.com/rs/857-LSW-455/images/Inbox_Zero_SQ%402x.png)\n\nInstantly connect 100% of email accounts with Hosted Auth.\n\n[READ MORE](https://email.nylas.com/K00O6LS00VNo3MBEQ0230W0)\n\n|\n![[email protected]](https://info.nylas.com/rs/857-LSW-455/images/Privacy_Shield_Ruling_SQ%402x.png)\n\nLearn what the recent Privacy Shield Ruling means for your users' data.\n\n[READ MORE](https://email.nylas.com/wSEW36BLV0000Q2N00O3p0N)
Before
Clean Conversations Configuration
You can control how Nylas processes your message information.
ignore_links
- Removes links in the conversation or signature. Default:true
ignore_images
- Remove images in the conversation or signature. Default:true
ignore_tables
- Remove tables in the conversation or signature. Default:true
remove_conclusion_phrases
- Remove phrases such as best and regards in the signature. Default:true
images_as_markdown
- Return images as markdown links. Default:false
Images
When processing images there are two available configurations:
ignore_images
- Remove images in the conversation or signature. Default:true
images_as_markdown
- Return images as markdown links. Default:true
To return images, set ignore_images:false
. If you prefer to return markdown, set images_as_markdown:true
and ignore_images:false
.
Inline Images
Inline images will return as part of the conversation and include a CID.
"conversation": "<img src='cid:1781777f666586677621' />\n\nImage from Gmail"
"conversation": "\n\nImage from Gmail"
// image_as_markdown
The CID is an internal ID for Nylas. To download the image, use the ID from the files object in the response.
Some inline images will return with a link to the original image source if available, otherwise, the CID will return.
Use the File ID to Download the Images
"files": [
{
"content_disposition": "inline",
"content_id": "{content_id}",
"content_type": "image/jpg",
"filename": "IMG_0864.jpg",
"id": "{file_id}",
"size": 2773662
}
],
Attached Images
Attached images do not return as part of the conversation. They can be found in the files object.
Use the File ID to Download the Images
"files": [
{
"content_disposition": "attachment",
"content_id": "{content_id}",
"content_type": "image/jpg",
"filename": "IMG_0864.jpg",
"id": "{file_id}",
"size": 2773662
}
],
Downloading Images
To download an image, make a POST request to https://api.nylas.com/files/{file_id}/download
.
Include the file ID from the files object in the Conversations response.
Conversations Response
"files": [
{
"content_disposition": "inline",
"content_id": "{content_id}",
"content_type": "image/jpg",
"filename": "IMG_0864.jpg",
"id": "{file_id}",
"size": 2773662
}
],
Download Files Request
The response will have a data file for download.
curl --location --request GET 'https://api.nylas.com/files/{file_id}/download' \
--header 'Authorization: Bearer {access_token}'
Return Plain Text
To return mostly plain text, use the following configuration:
This will remove images, tables, and links from the conversations object. Images will instead be part of the files object.
{
"message_id": [
"{message_id}"
],
"ignore_links": true,
"ignore_images": true,
"ignore_tables": true,
"remove_conclusion_phrases": true
}
Clean Conversation Message Feedback
If a message was cleaned up in the way you didn’t expect, you can send us feedback using the /neural/conversation/feedback
endpoint. We will use this data to retrain our model for better results in the future.
Send a POST request to /neural/conversation/feedback
with the request body:
- message_id - ID of the message you want to give feedback on.
Conversation Feedback Request
curl --location --request POST 'https://api.nylas.com/neural/conversation/feedback' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data-raw '{
"message_id":"<message_ID>"
}'
Conversation Feedback Response
The response includes:
- model_version - Version of the model parsing out the conversation.
- message_id - ID of the message that was not parsed correctly.
- feedback_at - Unix time feedback about the message was most recently given.
{
"model_version": "av45hcbkka",
"message_id": "812yzs4goqf4sl4ofswvalt4u",
"feedback_at": "1607537180",
}
Keep in Mind
- Forwarded messages will return an empty conversation.
- Only English is supported.
- No SDK support.
- Job Status and Webhooks are not available.