Skip to content

Nylas errors and HTTP status codes

This page is a reference list of API responses, error types, and HTTP status codes that you might encounter when working with Nylas.

You can also skip to the pages for more specific pages for error 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.

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.

For more information about specific error codes, see the following documentation:

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
}
}
}

HTTP status codes

Nylas uses a set of conventional HTTP response codes to indicate the success or failure of API requests.

HTTP Status CodeDescription
200 OKEverything worked as expected.
202 Not ReadyThe request was valid, but the resource wasn’t ready. Retry the request with exponential backoff.
400 Bad RequestThe request was malformed or missing a required parameter.
401 UnauthorizedCould not verify access credentials. No valid API key or access_token was provided.
402 Request Failed or Payment RequiredThe request parameters were valid, but the request failed or you must add a credit card to your organization.
403 ForbiddenThe request includes authentication errors, blocked developer applications, or cancelled accounts.
404 Not FoundThe requested item doesn’t exist.
405 Method Not AllowedYou tried to access a resource using an invalid method.
410 GoneThe requested resource has been removed from the Nylas servers.
413 Request Entity too LargeThe transmitted data value exceeds the capacity limit for Send, v3 Attachments, or v2 Files requests.
418 I’m a Teapot🫖
422 Sending ErrorThis response was returned during the sending process.
429 Too Many RequestsSlow down! If you legitimately require this many requests, contact Nylas Support.
500, 502, and 503 Server ErrorsAn error occurred in the Nylas server. If this persists, see the Nylas platform status page or contact Nylas Support.
504 Provider ErrorWait and try again later. If the problem persists, check with your service provider.

For more information, see Wikipedia’s list of HTTP status codes or the WebFX HTTP status codes database.