Nylas error responses: 500-599
500 responses return when there is an error on the server side.
Error 500 - Server Error
Cause
An error occurred in the Nylas server.
Solution
If this persists, see the Nylas status page.
Error 502 - Server Error
Cause
An error occurred in the Nylas server.
Solution
If this persists, see the Nylas status page.
Error 503 - Server Unavailable
Microsoft
Error 503’ Throttle Header, 'X-MS-ASThrottle: CommandFrequency
Cause
There are too many commands.
Solution
- Managed Exchange accounts should contact the administrator to increase the threshold for
CommandFrequency
. - The default value for
CommandFrequency
is to block after 400 commands in 10 minutes. Block for 20 minutes.
Error 503 - Server Error
Cause
An error occurred in the Nylas server.
Solution
If this persists, see our status page or contact support.
Error 504 - Provider Error
Status 504 usually means Nylas is having trouble connecting to the provider. The error message indicates the details of the failure.
In most cases if you use an exponential back-off retry, the request will eventually succeed. Some common reasons a request could fail with status 504 are listed below.
Request timed out
This error happens when a request takes a long time to process. Nylas has a request SLA of 90 seconds. If a request takes longer than 90 seconds, Nylas terminates it and sends a timeout error.
You might run into timeout errors in the following scenarios:
- Request fanout: For Microsoft grants, a single request to the Nylas Threads API can cause Nylas to make multiple Microsoft Graph API requests. Nylas has to make at least one Microsoft Graph API request per message in the thread you're working with, and the total time for all of the requests can easily exceed 90 seconds. To avoid this, try to retrieve, update, or delete individual messages from a thread instead of working with the thread itself. If you're experiencing timeout errors when listing threads, try your request again with a smaller
limit
. - Server busy: For on-premises Exchange grants, a request might time out when your Exchange server has too many requests to process. When this happens, you might also see
429
rate limit errors. When an Exchange server is overloaded, it can tell new requests to wait and try again later. The wait time could be 90 seconds or longer, which means that the request might exceed the Nylas SLA. To avoid this, try making fewer requests at the same time, and implement exponential backoff logic. - Slow IMAP server: For IMAP, a request can time out when the email server responds slowly to large requests (for example, when you update or delete a thread). If this happens often, Nylas recommends contacting your IMAP administrator and asking them to scale up their servers.
- Post filtering: Nylas supports many request filters that provider APIs might not use (for example, Google doesn't support the
location
filter on Return all Events requests), or that might be case-sensitive on the provider. In these cases, Nylas makes a request to the provider APIs without the filter, receives the response, and searches for the results that match the filter in your request. This might result in a request timeout, especially if the provider returns a long list of results or there are no results that match your filter. To avoid timeouts, try searching for objects in a smaller window of time, or use a largerlimit
so Nylas can paginate through the results more quickly. You might encounter this with the following endpoints and filters:- Return all Events
- Google:
attendees
,description
,location
,title
,updated_after
,updated_before
- Microsoft:
attendees
,description
,location
,title
,updated_after
,updated_before
- iCloud:
attendees
,description
,location
,master_event_id
,title
,updated_after
,updated_before
- EWS: All filters
- Google:
- Return all Threads
- Microsoft:
starred
,unread
- Microsoft:
- Return all Contacts
- Google:
email
,group
,phone_number
- Google:
- Return all Events
IMAP server errors
This error happens when an IMAP server does not support certain operations, such as renaming or removing a system folder. It can also happen if the IMAP server is unstable.
There is nothing Nylas can do in these cases as this is an issue with the IMAP provider's server, and Nylas does not control or administer the provider's servers. Your best course of action is to contact the IMAP administrator and ask them to support specific IMAP commands or find out what is making the server unstable (and fix it).
Internal errors
Sometimes, the Google API and Microsoft Graph API return internal errors. This is usually caused by bugs in the Google or Microsoft API. Contact Nylas support if you encounter this very often.
Error 550 - Service Unavailable
The message was classified as spam and may not be delivered.
Cause
Some email providers review all outbound emails through their spam filter before sending, to preserve their email-sending reputation. Spam filters work by comparing emails to an extensive list of matching behaviors and giving each behavior a score. We return that the email was blocked for spam in the API response, but we don't have any visibility into exactly what caused the block.
Solution
Take a look at our docs on Dealing with spam.