Skip to content

Error types in Nylas

This page is a reference list for error types that you might encounter when working with Nylas v3. For more information, see Nylas API responses, errors, and HTTP status codes.

Error types

Error messages include a JSON object that contains a standard set of attributes, including the error’s type and a human-readable message string. These are designed to make debugging easier and allow for you to handle different scenarios that produce the same HTTP error code.

The table below shows the error types you might encounter while working with Nylas.

Error TypeHTTP CodeDefault Message
api.authentication_error401Unauthorized
api.internal_error500Internal error, contact administrator.
api.invalid_request_error400Bad request
api.invalid_request_payload400Invalid JSON payload format.
api.provider_error504Provider error message. (Specific Provider HTTP code response possible.)
api.not_found_error404Resource not found.
api.resource_blocked423Resource blocked, contact administrator.
api.partial_not_found_error404Partially missing data from requested resource(s).
api.partial_success_error504One or more objects could not be handled. (Specific Provider HTTP code response possible.)
api.rate_limit_error429Rate limit error.
token.unauthorized_access400Invalid API key.
token.exchange_failed400OAuth 2.0 token exchange failed.
grant.callback_uri_not_allowed400callback_uri is not allowed for this connector.
grant.login_id_invalid400Login ID or request is invalid or has expired.
grant.not_found404Grant not found.
grant.refresh_token_invalid401Invalid refresh_token supplied to Grant.
grant.provider_required400Provider field is required.
grant.reauth_email_invalid400Email addresses did not match during re-authentication.
grant.scopes_conflict400Some requested scopes were not included in the completed hosted auth, resulting in denied authentication.
grant.gmail_domain_invalid400Gmail domain is not allowed, resulting in denied authentication.
grant.access_denied403Access to Grant denied.
grant.invalid_authentication400Authentication failed due to wrong input or credentials.
grant.provider_not_responding400Provider not responding.
grant.auth_limit_reached400Maximum number of retries reached for hosted auth.
grant.imap_type_mismatch400IMAP provider mismatch.
grant.provider_mismatch400Grant provider mismatch.
grant.imap_autodetect_fail400IMAP auto-detection failed. Please provide additional IMAP configuration (host, port).
grant.hosted_login_expired400Hosted login expired.
grant.session_revoke_failed400Session revoke failed.
grant.provider_id_token_missing400Provider did not return ID token for authorized account.
connector.not_found404Connector not found.
connector.provider_not_supported400Provider invalid or not supported.
connector.provider_settings_invalid400Provider settings not supported.
connector.provider_settings_secret_required400Provider settings and Secret both are required if one needs to change.
connector.already_exists400Connector already exists.
connector.problem400Issues found with connector’s settings or configuration.
credential.not_found404Credential not found.
credential.already_exists400Credential with this name for given connector already exists.
credential.missing_param400Credential is missing some essential values in its settings.
connector.no_longer_exists400Connector no longer exists.
oauth2.provider_code_request_failed400Provider refused to return refresh_token using code.
oauth2.oauth_failed400Hosted OAuth failed due to rejection by provider or user refusing consent.
oauth2.invalid_client400OAuth client not found.
oauth2.invalid_grant400Error creating grant with provided OAuth parameters.
oauth2.redirect_uri_mismatch400Redirect URI not allowed.
oauth2.unsupported_grant_type400Invalid grant_type.
oauth2.invalid_token401Token expired or revoked.
oauth2.oauth_provider_error400Error from OAuth 2.0 provider.
oauth2.origin_not_allowed400Error origin not allowed for callback_uri for platform:js.
oauth2.provider_code_exchange_failed403Code exchange to get access/refresh token failed on provider’s side.
application.missing_required_parameter400One of the platform’s required parameters is missing.
application.not_found404Application not found.
application.callback_uris_not_found404Application’s redirect URIs not found.
application.callback_uri_is_not_valid400Application’s redirect URI is not valid.
application.id_not_allowed403Application ID not allowed.
common.scope_not_allowed400One or more provided scopes is not allowed.
common.secret_not_found404Searched Secret record not found.
v3_migration.account_to_grant_migration_failed400Account migration to a V3 grant failed.
v3_migration.translate_resource_failed400Failed to translate Nylas resource ID to Provider resource ID.
v3_migration.link_apps_failed400Failed to link v2 & v3 applications.
v3_migration.app_import_failed400Failed to import v2 application’s settings to v3 application.
v3_migration.job_start_failed400Failed start migration jobs.
v3_migration.get_jobs_failed404Failed to get info of migration jobs.

Sample HTTP error response

The following JSON snippet is an example of an HTTP error response that you might receive from Nylas.

{
"request_id": "1f58962d-9967-42de-9dd3-3f55aa1a216a",
"error": {
"type": "invalid_request_error",
"message": "The message_id parameter is required."
}
}

Sample HTTP provider error response

HTTP errors include the provider_error parameter only when they’re generated by the provider or connector, as in the following example.

{
"request_id": "1f58962d-9967-42de-9dd3-3f55aa1a216a",
"error": {
"type": "invalid_request_error",
"message": "The message_id parameter is required.",
"provider_error": {
// Provider error response
}
}
}