Only show these results:

Categorizer Guide

The Categorize endpoint can help you make sense of a messy inbox. By organizing messages into emails from humans vs. emails from machines, you can remove the noise from your user’s inbox.

You’ll learn how to categorize your messages and how to help Nylas train the machine learning model.

How Categorize Works

Nylas uses a machine-learning algorithm to determine which messages are sent by a human and which are sent by a machine.

Messages are categorized by:

  • Conversation - These are messages that another human has sent from an email client. If the last message in the thread was sent manually or written by a human it is considered a conversation.
  • Feed - These are emails that are sent by a machine. For example, newsletters and email confirmations.

Categorize

Before you can get the message category, you’ll need to have the message_id of the message you want to categorize. Use the /messages endpoint to get a list of message IDs.

Then you can categorize the message by sending a PUT request to /neural/categorize.

Categorize Message Request

curl --location --request PUT 'https://api.nylas.com/neural/categorize' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message_id": "[10vg4dz96l004qluhp5rk7gbb]"
}'

Categorize Message Response

As part of the response, the category is returned:

  • category - The category of the message. Conversations are messages sent by a human. Feeds are emails sent by a computer such as email confirmations and spam.
  • categorized_at - UNIX formatted time of when the message category was most recently updated.
  • model_version - Version of the model categorizing 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&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\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/group-14@3x.png\"> </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=\"Virtual_Calendar_NewsletterHero@2x.png\" 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:&#39;Lato&#39;,Arial,sans-serif;font-size:14px;line-height:23px;border-collapse:collapse\"> \n<div id=\"m_4815224842221839925text1\">\n<h2 style=\"text-align:center\">Schedule&nbsp;Securely With&nbsp;Virtual Calendars</h2> \n<p style=\"text-align:center\"><span style=\"font-size:11pt;font-family:&#39;Source Sans Pro&#39;,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=\"Inbox_Zero_SQ@2x.png\" 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=\"Privacy_Shield_Ruling_SQ@2x.png\" 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&#39; 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:&#39;Lato&#39;,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:&#39;Lato&#39;,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/nylas_twitter@4x.png\" 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/nylas_github@4x.png\" 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/nylas_facebook@4x.png\" 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/nylas_linkedin@4x.png\" 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:&#39;Lato&#39;,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&amp;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&amp;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:&quot;Source Sans Pro&quot;,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:&quot;Source Sans Pro&quot;,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:&quot;Source Sans Pro&quot;,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:&quot;Source Sans Pro&quot;,sans-serif;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\"><a href=\"mailto:swag@nylas.com\" target=\"_blank\">swag@nylas.com</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>",
"categorized_at": 1608244650.0782313,
"category": "feed",
"cc": [],
"date": 1608244442,
"events": [],
"files": [],
"from": [
{
"email": "carver@agritech.com",
"name": "George Washington Carver"
}
],
"id": "**********",
"labels": [
{
"display_name": "Important",
"id": "c2ig7rwrpethf9bqoaq7tnerm",
"name": "important"
},
{
"display_name": "Inbox",
"id": "cgf6uw9mvagi1fibv67kgz7z",
"name": "inbox"
}
],
"model_version": "1734dc47",
"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": "dorothy@spacetech.com",
"name": "Dorothy Vaughan"
}
],
"unread": false
}

Categorize Feedback

If a message was categorized in a way you didn't expect, you can help Nylas train it’s algorithm by recategorizing the message. Making a POST request will immediately recategorize the message and message threads.

Send a POST request to /neural/categorize/feedback with the request body:

  • message_id - ID of the message you want to change the category of.
  • category - The new message category. Either feed or conversation.

Categorize Feedback Request

curl --location --request POST 'https://api.nylas.com/neural/categorize/feedback' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data-raw '{
"message_id":"<meesage_ID>",
"category" : "<new_message_category>"
}'

Category Feedback Response

The category feedback response includes:

  • category - New message category. Either conversation or feed.
  • message_id - ID of the message recategorized
  • feedback_at - Time the message feedback was received in Unix timestamp.
  • recategorized_from - Object with old message category.
  • category - Old message category. Either conversation or feed.
  • model_version - Version of the model categorizing the conversation.
{
"message_id": "sfgdfgrt******",
"category": "feed",
"feedback_at": 1608303697,
"recategorized_from": {
"category": "conversation",
"model_version": 'xxx000',
}
}

Keep In Mind

  • Making a POST request will immediately recategorize the message and message threads.
  • Only English is supported.
  • No SDK support.
  • Job Status and Webhooks are not available.
  • Emails are not categorized in real-time. Make a PUT request to /neural/categorize.

What's Next