Pricing

Docs

Guides

Error handling

Learn about the errors that Smartcar returns and how to resolve them.


Our API uses common HTTP response codes to indicate the success or failure of an API request.

In the case of client or server errors, Smartcar will return 4xx and 5xx errors, along with an error name and message in a JSON body.

  1. 4xx error codes indicate an error within the API request.
  2. 5xx error codes indicate an error on Smartcar's side.

There are three situations in which you can expect errors:

  1. Smartcar Connect - when you are retrieving an authorization code
  2. Token Exchange - when you are exchanging your code for an access_token
  3. API Request - when you are making a request to a vehicle

Smartcar Connect errors

The following errors can be returned as query parameters when a user is redirected to your redirect_uri from Smartcar Connect.

ACCESS_DENIED

During Connect, the user has explicitly denied your application access to their vehicle. We recommend that you handle this error by displaying an error message to the user, prompting them to re-attempt authorization.

VEHICLE_INCOMPATIBLE

The user's vehicle is not compatible. A compatible vehicle is one that:
  1. has the hardware required for internet connectivity,
  2. belongs to the makes and models Smartcar supports, and
  3. has the functionalities required by the requested permissions.

Connect will return the VIN, make, model, and year if possible.


Token exchange errors

The following errors can occur when you are exchanging your authorization code or refresh_token for an access_token.

INVALID_CLIENT

The provided client credentials are incorrect. We recommend that you compare the credentials you entered with the ones Smartcar provided to you in the developer dashboard.

INVALID_GRANT

Smartcar will return this error if the provided authorization grant (e.g. authorization code) or refresh_token -

  1. is invalid, expired, or revoked.
  2. does not match the redirect_uri used in the authorization request.
  3. was issued to another client.
  4. has already been exchanged once.

INVALID_CLIENT

The provided client credentials are incorrect. We recommend that you compare the credentials you entered with the ones Smartcar provided to you in the developer dashboard.

INVALID_REQUEST

The request is malformed. Refer to the API reference to ensure you are constructing a valid request.

UNAUTHORIZED_CLIENT

You are not authorized to perform this action. Please contact Smartcar (support@smartcar.com) for further information.

UNSUPPORTED_GRANT_TYPE_ERROR

Smartcar does not support the grant type that your API request has provided. Refer to the API reference to view valid grant types.

API request errors

The following errors can occur when you are making a request to a vehicle.

VALIDATION_ERROR

Your request contains invalid or missing parameters. Refer to the API reference to ensure that the parameters of your request are correct.

AUTHENTICATION_ERROR

Smartcar will return this error if -

  1. the provided access_token is invalid or expired.
  2. the user has not authenticated themselves. We recommend you handle this error by prompting the user to re-attempt authentication.

PERMISSION_ERROR

You do not have the required permissions to perform this action. Refer to the API reference to ensure you are requesting the correct permissions.

RESOURCE_NOT_FOUND_ERROR

The requested resource does not exist.

VEHICLE_STATE_ERROR

In its current state, the vehicle is not capable of fulfilling your request (e.g. you cannot lock a vehicle when its doors are open).

RATE_LIMITING_ERROR

Your application has sent too many requests and should slow down.

MONTHLY_LIMIT_EXCEEDED

Your application has exceeded its monthly request limit.

SERVER_ERROR

Smartcar's server experienced an unexpected error. We apologize and recommend that you try to send your request once more.

NOT_CAPABLE_ERROR

The vehicle is not capable of fulfilling this request.


Next steps