# Make Specific Endpoints Source: https://smartcar.com/docs/api-reference/about-brand-specific In cases where there are many differences in how each OEM provides the same data, Smartcar will provide you with a make-specific endpoint before making it widely available to all supported makes. This allows our customers to start taking advantage of these endpoints and share feedback with Smartcar earlier. These endpoints will maintain consistent behavior and will not "break" with future releases. In time, a make-specific endpoint might be standardized across various makes, eliminating the need to indicate the make in the URL. You won't need to modify your code but you might benefit from a newly standardized version. When using make specific endpoints, please ensure to specify the make in lower case format. Using upper case letters will result in a PERMISSION error. # All Vehicles Source: https://smartcar.com/docs/api-reference/all-vehicles GET /vehicles Returns a paged list of all vehicles connected to the application for the current authorized `user`. ## Request **Query** The number of vehicles to return per page. `Max: 50` The index to start the `vehicles` list at. ## Response Metadata about the current list of elements. The total number of elements for the entire query (not just the given page). The current start index of the returned list of elements. An array of vehicle IDs. ```json Example Response { "paging": { "count": 25, "offset": 10 }, "vehicles": [ "36ab27d0-fd9d-4455-823a-ce30af709ffc" ] } ``` # API Errors Source: https://smartcar.com/docs/api-reference/api-errors Smartcar uses HTTP status codes to indicate success or failure of API requests. This includes: * `2XX`: indicates success * `4XX`: indicates an invalid request (e.g. a required parameter is missing from the request body) * `5XX`: indicates Smartcar-related issues (e.g. a vehicle is not capable of fulfilling a request). ## Error Response All Smartcar errors contain the following fields: | Name | Type | Description | | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | type | string | A unique identifier that groups codes into broad categories of errors | | code | string | A short, descriptive identifier for the error that occurred | | description | string | A short description of the code that provides additional information about the error. The description is always provided in English. | | docURL | string | A link to Smartcar’s doc center guide for the given type and code | | statusCode | number | The HTTP status code | | requestId | string | Smartcar’s request ID | | resolution | object | An object with at least one enumerated property named as "type" that specifies which action can be taken to resolve this error. There are three possible values for the property "type": `RETRY_LATER` - Retry the request at a later time; `REAUTHENTICATE` - Prompt the user to re-authenticate in Smartcar Connect; and `CONTACT_SUPPORT` - Contact Smartcar’s support team. This object could contain other properties depending on the "type" of error. | | detail | array | An array of objects that provide further detail regarding the error. Only included with validation errors. | ## Error Codes | Code | Type | Status | | ----------------------------- | ---------------------------- | ------ | | `ACCOUNT_ISSUE` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `AUTHENTICATION_FAILED` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `NO_VEHICLES` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `PERMISSION` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `SUBSCRIPTION` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `VEHICLE_MISSING` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `VIRTUAL_KEY_REQUIRED` | `CONNECTED_SERVICES_ACCOUNT` | 400 | | `null` | `VALIDATION` | 400 | | `PARAMETER` | `VALIDATION` | 400 | | `null` | `AUTHENTICATION` | 401 | | `null` | `PERMISSION` | 403 | | `PATH` | `RESOURCE_NOT_FOUND` | 404 | | `VERSION` | `RESOURCE_NOT_FOUND` | 404 | | `ASLEEP` | `VEHICLE_STATE` | 409 | | `CHARGING_IN_PROGRESS` | `VEHICLE_STATE` | 409 | | `CHARGE_FAULT` | `VEHICLE_STATE` | 409 | | `NOT_CHARGING` | `VEHICLE_STATE` | 409 | | `CHARGING_PLUG_NOT_CONNECTED` | `VEHICLE_STATE` | 409 | | `CHARGING_PLUG_CONNECTED` | `VEHICLE_STATE` | 409 | | `DOOR_OPEN` | `VEHICLE_STATE` | 409 | | `FULLY_CHARGED` | `VEHICLE_STATE` | 409 | | `HOOD_OPEN` | `VEHICLE_STATE` | 409 | | `IGNITION_ON` | `VEHICLE_STATE` | 409 | | `IN_MOTION` | `VEHICLE_STATE` | 409 | | `LOW_BATTERY` | `VEHICLE_STATE` | 409 | | `REMOTE_ACCESS_DISABLED` | `VEHICLE_STATE` | 409 | | `TRUNK_OPEN` | `VEHICLE_STATE` | 409 | | `UNKNOWN` | `VEHICLE_STATE` | 409 | | `UNREACHABLE` | `VEHICLE_STATE` | 409 | | `VEHICLE_OFFLINE_FOR_SERVICE` | `VEHICLE_STATE` | 409 | | `VEHICLE` | `RATE_LIMIT` | 429 | | `SMARTCAR_API` | `RATE_LIMIT` | 429 | | `INVALID_PLAN` | `BILLING` | 430 | | `VEHICLE_LIMIT` | `BILLING` | 430 | | `VEHICLE_REQUEST_LIMIT` | `BILLING` | 430 | | `ACCOUNT_SUSPENDED` | `BILLING` | 430 | | `INTERNAL` | `SERVER` | 500 | | `INTERNAL` | `MULTIPLE_RECORDS_FOUND` | 500 | | `INTERNAL` | `RECORD_NOT_FOUND` | 500 | | `MAKE_NOT_COMPATIBLE` | `COMPATIBILITY` | 501 | | `SMARTCAR_NOT_CAPABLE` | `COMPATIBILITY` | 501 | | `VEHICLE_NOT_CAPABLE` | `COMPATIBILITY` | 501 | | `PLATFORM_NOT_CAPABLE` | `COMPATIBILITY` | 501 | | `INVALID_DATA` | `UPSTREAM` | 502 | | `KNOWN_ISSUE` | `UPSTREAM` | 502 | | `NO_RESPONSE` | `UPSTREAM` | 502 | | `RATE_LIMIT` | `UPSTREAM` | 502 | | `UNKNOWN_ISSUE` | `UPSTREAM` | 502 | # SDKs Source: https://smartcar.com/docs/api-reference/api-sdks Our backend SDKs simplify the process of making calls to our API.
While we provide a number of SDKs for popular languages, you do not need to use an SDK to integrate with our API. Our APIs are just standard HTTP endpoints that can be reached with any HTTP library of your choice. # Permissions Source: https://smartcar.com/docs/api-reference/application-permissions GET /vehicles/{id}/permissions Returns a list of the permissions that have been granted to your application in relation to this vehicle. ## Request The vehicle id. The number of vehicles to return per page. `Max: 50` The index to start vehicle list at. ## Response An array of [permissions](/api-reference/permissions). Metadata about the current list of elements. The total number of elements for the entire query (not just the given page). The current start index of the returned list of elements. ```json Example Response { "paging": { "count": 25, "offset": 10 }, "permissions": [ "read_vehicle_info" ] } ``` # Audi: Charge Status Source: https://smartcar.com/docs/api-reference/audi/get-charge GET /vehicles/{id}/{make}/charge Returns all charging related data for an Audi vehicle. ## Permission `read_charge` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python charge = vehicle.request( "GET", "{make}/charge" ) ``` ```js Node const charge = await vehicle.request( "GET", "{make}/charge" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/charge") .build(); VehicleResponse charge = vehicle.request(request); ``` ```ruby Ruby charge = vehicle.request( "GET", "{make}/charge" ) ``` ## Request **Path** ## Response Indicates the charging status of the vehicle Indicates if the vehicle is plugged in The instant power measured by the vehicle (in kilowatts). The rate of range added in the charging session (in kilometers added / hour). Indicates the type of charger. The indicator light color of the connector. Indicates if the charge port latch status. An ISO8601 formatted datetime (YYYY-MM-DDTHH:mm:ss.SSSZ) for the time at which the vehicle expects to complete this charging session. Indicates if the vehicle is set to charge on a timer. One of `manual` or `timer`. Indicates the level at which the vehicle will stop charging and be considered fully charged as a percentage. When plugged in indicates if the charging station is able to provide power to the vehicle. ```json Example Response { "chargingStatus": "CHARGING", "isPluggedIn": null, "chargeRate": 21, "chargeType": "ac", "chargePortColor": "green", "chargePortLatch": "locked", "completionTime": "2022-01-13T22:52:55.358Z", "chargeMode": "manual", "socLimit": 0.8, "externalPowerStatus": "active", "wattage" : 1.5 } ``` # Auth Code Exchange Source: https://smartcar.com/docs/api-reference/authorization/auth-code-exchange POST https://auth.smartcar.com/oauth/token To interact with the Smartcar API, you will need to exchange your authorization code from the [Connect redirect](/docs/connect/handle-the-response) for an access token. See [Token Management](https://smartcar.com/docs/connect/token-management/overview) for an overview. # Token Refresh Source: https://smartcar.com/docs/api-reference/authorization/token-refresh POST https://auth.smartcar.com/oauth/token Your access token will expire 2 hours after it is issued. When this happens, your application can retrieve a new one by using the `refresh_token` returned in the [auth code exchange](/docs/api-reference/authorization/auth-code-exchange) or prior token refresh. See [Token Refresh](https://smartcar.com/docs/connect/token-management/refreshing-access-token) for additional guidance. # Batch Source: https://smartcar.com/docs/api-reference/batch POST /vehicles/{id}/batch Returns a list of responses from multiple Smartcar `GET` endpoints, all combined into a single request. Each endpoint in the batch counts against your [request limit](/errors/api-errors/billing-errors) for a vehicle. ## Request **Path** **Body** An array of requests to make. The Smartcar endpoint to request data from. ## Response The responses from Smartcar. The headers for this response. The unit system to use for the request. The timestamp (ISO-8601 format) of when the returned data was recorded by the vehicle. The HTTP response status code. The Smartcar endpoint to request data from. The response body of this request. The structure of this object will vary by endpoint. See the according endpoint specification. ```json Example Response { "responses": [ { "path": "/odometer", "body": { "distance": 37829 }, "code": 200, "headers": { "sc-data-age": "2019-10-24T00:43:46.000Z", "sc-unit-system": "metric" } }, { "path": "/location", "body": { "latitude": 37.4292, "longitude": 122.1381 }, "code": 200, "headers": { "sc-data-age": "2019-10-24T00:43:46.000Z" } } ] } ``` # Charge Records Source: https://smartcar.com/docs/api-reference/bmw/get-charge-records GET /vehicles/{id}/{make}/charge/records Returns data associated with completed charging sessions for a vehicle. Limited to the last 30 days or when the owner first granted your application access, which ever is shorter. This endpoint is currently available for `bmw` and `mini` ## Permission `read_charge_records` ## Request **Path** **Query** Date of the first record to return in YYYY-MM-DD format. Defaults to 30 days prior or when the owner first granted your application access, whichever is shorter. Date of the final record to return in YYYY-MM-DD format. Defaults to the date of the request. ## Response An array of charge records for the vehicle. The start date of the charging record, formatted in ISO 8601 standard The end date of the charging record, formatted in ISO 8601 standard Location of the charge session. The amount of energy consumed during the charging session. Indicates whether the charging location is public or not. The remaining battery soc at the start of the charging session. The remaining battery soc at the end of the charging session. The type of charger used for the session. ```json Example Response { "records": [ { "chargeStart" : "2023-03-08T12:54:44Z", "chargeEnd" : "2023-03-08T14:14:44Z", "location": "Cockfosters Road, Barnet, EN4 0", "energy" : 34.22998046875, "isPublic" : true, "startPercentRemaining" : 0.57, "endPercentRemaining" : 1, "chargingType" : "DC" } ] } ``` # By Region and Make Source: https://smartcar.com/docs/api-reference/compatibility/by-region-and-make GET /compatibility/matrix Compatibility will vary by model, year, and trim. This API is for reference purposes only and it showcases vehicle makes and models that may be compatible with Smartcar and it does not guarantee that a specific vehicle will be compatible. The Compatibility API is an Enterprise feature. Please [contact us](https://smartcar.com/pricing/) to upgrade your plan. Compatibility by region and make allows developers to query the latest version of our Compatibility Matrix based on region, engine type, make, and permission. ## Request **Headers** **Query** One of the following regions: `US`, `CA` or `EUROPE` Queries for all engine types if none are specified. A space-separated list of makes. Valid makes for a given region can be found in the makes section. This field is optional. If no make is specified, all makes will be returned. A space-separated list of [permissions](/api-reference/permissions). Queries for all permissions if none are specified. ## Response An array of models supported for the given `make`. `model` for the given `make`. The earliest model year supported by Smartcar. The latest model year supported by Smartcar. Engine type for the given `model`. An array of endpoints supported for the given `model`. An array of `permissions` supported for the given `model`. ```json Example Response { "NISSAN": [ { "model": "LEAF", "startYear": 2018, "endYear": 2022, "type": "BEV", "endpoints": [ "EV battery", "EV charging status", "Location", "Lock & unlock", "Odometer" ], "permissions": [ "read_battery", "read_charge", "read_location", "control_security", "read_odometer" ] } ], "TESLA": [ { "model": "3", "startYear": 2017, "endYear": 2023, "type": "BEV", "endpoints": [ "EV battery", "EV charging status", "EV start & stop charge", "Location", "Lock & unlock", "Odometer", "Tire pressure" ], "permissions": [ "read_battery", "read_charge", "control_charge", "read_location", "control_security", "read_odometer", "read_tires" ] } ] } ``` # By VIN Source: https://smartcar.com/docs/api-reference/compatibility/by-vin GET /compatibility Compatibility will vary by model, year, and trim. This API is for reference purposes only and it showcases vehicle makes and models that may be compatible with Smartcar and it does not guarantee that a specific vehicle will be compatible. The Compatibility API is an Enterprise feature. Please [contact us](https://smartcar.com/pricing/) to upgrade your plan. Compatibility by VIN allows developers to determine if a specific vehicle could be compatible with Smartcar. A vehicle is capable of a given feature if: 1. The vehicle supports the feature (e.g., a Ford Escape supports /fuel but a Mustang Mach-e does not) 2. Smartcar supports the feature for the vehicle's make This endpoint only supports checking capabilities for vehicles sold in the United States. It **does not** support checking `capabilities` for VINs in Canada and Europe. ## Request **Headers** **Parameters** The VIN (Vehicle Identification Number) of the vehicle. A space-separated list of permissions. An optional country code string according to ISO 3166-1 alpha-2. ## Response `true` if the vehicle is likely compatible, `false` otherwise. One of the reasons described below if compatible is `false`, `null` otherwise The vehicle does not have the hardware required for internet connectivity Smartcar is not yet compatible with the vehicle's make in the specified country An array containing capability objects for the set of endpoints that the provided scope value can provide authorization for. This array will be empty if `compatible` is `false`. One of the permissions provided in the scope parameter One of the endpoints that the permission authorizes access to `true` if the vehicle is likely capable of this feature, `false` otherwise One of the reasons described below if capable is `false`, `null` otherwise The vehicle does not support this feature Smartcar is not capable of supporting the given feature on the vehicle's make ```json Example Response { "compatible": true, "reason": null, "capabilities": [ { "capable": false, "endpoint": "/engine/oil", "permission": "read_engine_oil", "reason": "SMARTCAR_NOT_CAPABLE" }, { "capable": true, "endpoint": "/battery", "permission": "read_battery", "reason": null }, { "capable": true, "endpoint": "/battery/capacity", "permission": "read_battery", "reason": null }, { "capable": true, "endpoint": "/vin", "permission": "read_vin", "reason": null } ] } ``` A vehicle's compatibility depends on many factors such as its make, model, model year, trim, etc. The API optimizes returning false positives. # Lock & Unlock Source: https://smartcar.com/docs/api-reference/control-lock-unlock POST /vehicles/{id}/security Lock or unlock the vehicle. ## Permission `control_security` ## Request **Path** **Body** `LOCK` or `UNLOCK` the vehicle’s doors. ## Response If the request is successful, Smartcar will return “success” (HTTP 200 status). If the request is successful, Smartcar will return a message (HTTP 200 status). ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Start & Stop Charge Source: https://smartcar.com/docs/api-reference/evs/control-charge POST /vehicles/{id}/charge Start or stop the vehicle charging. ## Permission `control_charge` ## Request **Path** **Body** `START` or `STOP` the vehicle charging. ## Response If the request is successful, Smartcar will return “success”. If the request is successful, Smartcar will return a message. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` ## Notes **BMW and MINI**
Vehicle needs to be on OS Version 8+ **Ford and Lincoln**
Issuing a start command while the vehicle has a schedule in place for its current charging location will result in the vehicle charging to 100%. Please see [charge schedule by location](/api-reference/ford/set-charge-schedule-by-location) for details on setting a charge limit with preferred charging times or clearing schedules. **Nissan**
Currently only START charge commands are supported in the US. See [Set Charge Schedule](/api-reference/nissan/set-charge-schedule) for details on setting a charge schedule for Nissan vehicles. **Chevrolet, GMC, Buick and Cadillac**
These vehicles require a minimum charge of 50% in order to be able to start or stop charging via the API. # Battery Level Source: https://smartcar.com/docs/api-reference/evs/get-battery-level GET /vehicles/{id}/battery Returns the state of charge and the remaining range of an electric vehicle's high voltage battery. ## Permission `read_battery` ## Request **Path** ## Response The EV's state of charge as a percentage. The estimated remaining distance the vehicle can travel powered by its high voltage battery. ```json Example Response { "percentRemaining": 0.3, "range": 40.5 } ``` # Charge Limit Source: https://smartcar.com/docs/api-reference/evs/get-charge-limit GET /vehicles/{id}/charge/limit Returns the charge limit configuration for the vehicle. ## Permission `read_charge` ## Request **Path** ## Response The level at which the vehicle will stop charging and be considered fully charged as a percentage. ```json Example Response { "limit": 0.8, } ``` ## Notes This endpoint will return a [`CHARGING_PLUG_NOT_CONNECTED`](/errors/api-errors/vehicle-state-errors#charging-plug-not-connected) error if the OEM is unable to provide a charge limit unless the vehicle is plugged in. **Ford and Lincoln**
If a vehicle starts charing as a result of a [start charge](/api-reference/evs/control-charge) request, this endpoint will always return `1` if the charging location has a schedule in place. For the vehicle to respect its charge limit, please set one along with preferred charge times or clear the schedule through through the [charge schedule by location](/api-reference/ford/set-charge-schedule-by-location) endpoint. **BMW and MINI**
Vehicle needs to be on OS Version 8+ # Charge Status Source: https://smartcar.com/docs/api-reference/evs/get-charge-status GET /vehicles/{id}/charge Returns the charge status for the vehicle. ## Permission `read_charge` ## Request **Path** ## Response Indicates whether a charging cable is currently plugged into the vehicle’s charge port. Returns the current charge status of a vehicle. A vehicle can be `FULLY_CHARGED` at less than 100% SoC if its [Charge Limit](/api-reference/evs/get-charge-limit) is less than `1`. ```json Example Response { "isPluggedIn": true, "state": "FULLY_CHARGED" } ``` # Charge Limit Source: https://smartcar.com/docs/api-reference/evs/set-charge-limit POST /vehicles/{id}/charge/limit Set the charge limit of an electric vehicle. ## Permission `control_charge` ## Request **Path** **Body** The level at which the vehicle should stop charging and be considered fully charged. Cannot be less than `0.5`, or greater than `1`. ## Response If the request is successful, Smartcar will return “success” (HTTP 200 status). If the request is successful, Smartcar will return a message (HTTP 200 status). ## Notes This endpoint will return a [`CHARGING_PLUG_NOT_CONNECTED`](/errors/api-errors/vehicle-state-errors#charging-plug-not-connected) error if the OEM is unable to set a charge limit while the vehicle is unpluged. **Ford and Lincoln**
If a vehicle starts charing as a result of a [start charge](/api-reference/evs/control-charge) request it will always charge to 100% if the charging location has a schedule in place. For the vehicle to respect its charge limit, please set one along with preferred charge times or clear the schedule through the [charge schedule by location](/api-reference/ford/set-charge-schedule-by-location) endpoint. **BMW and MINI**
Vehicle needs to be on OS Version 8+ ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Charge Schedule by Location Source: https://smartcar.com/docs/api-reference/ford/get-charge-schedule-by-location GET /vehicles/{id}/{make}/charge/schedule_by_location Returns all saved charging locations for a vehicle and their associated charging limits, schedules and configurations. ## Permission `read_charge_locations` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/schedule_by_location" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python chargeScheduleByLocation = vehicle.request( "GET", "{make}/charge/schedule_by_location" ) ``` ```js Node const chargeScheduleByLocation = await vehicle.request( "GET", "{make}/charge/schedule_by_location" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/charge/schedule_by_location") .build(); VehicleResponse getChargeScheduleByLocation = vehicle.request(request) ``` ```ruby Ruby chargeScheduleByLocation = vehicle.request( "GET", "{make}/charge/schedule_by_location" ) ``` ## Response An array of charging locations. Empty if none are currently set on the vehicle. The maximum charge limit for the vehicle at the location as a percent. The latitude and longitude of the charging location. The longitude of the charging location. The latitude of the charging location. The weekday and weekend charging schedules for the vehicle at the location. The charging schedule for the vehicle on weekdays (Monday - Friday). The exact hour a vehicle should start charging in HH:00 e.g. 17:00. The exact hour a vehicle should stop charging in HH:00 e.g. 21:00. The charging schedule for the vehicle on weekends (Saturday - Sunday). The exact hour a vehicle should start charging in HH:00 e.g. 17:00. The exact hour a vehicle should stop charging in HH:00 e.g. 21:00. ```json Example Response { "chargingLocations": [ { "chargeLimit": 0.8, "chargingSchedules": { "weekday": [ { "end": "17:00", "start": "09:00" } ], "weekend": [ { "end": "17:00", "start": "09:00" } ] }, "location": { "latitude": 48.8566, "longitude": 2.3522 } } ] } ``` ## Example Schedule States ```json { "chargingLocations": [ { "chargeLimit": 0.8, "chargingSchedules": { "weekday": [], "weekend": [] }, "location": { "latitude": 48.8566, "longitude": 2.3522 } } ] } ``` ```json { "chargingLocations": [ { "chargeLimit": 0.8, "chargingSchedules": { "weekday": [ { "end": "17:00", "start": "09:00" } ], "weekend": [] }, "location": { "latitude": 48.8566, "longitude": 2.3522 } } ] } ``` ```json { "chargingLocation" : { "chargeLimit": 0.9, "chargingSchedules": { "weekday": [], "weekend": [ { "start": "16:00", "end": "07:00" } ] } } } ``` # Charge Schedule by Location Source: https://smartcar.com/docs/api-reference/ford/set-charge-schedule-by-location PUT /vehicles/{id}/{make}/charge/schedule_by_location Set all schedules for the specified charging location. ## Permission `control_charge` ## Request In order to set a schedule, you must use a location from the [`GET Charge Schedule by Location`](/api-reference/ford/get-charge-schedule-by-location) endpoint. If the location you want to manage is not in the response, the vehicle owner has not charged at that location within the last 90 days and it has been removed from their app's saved charging location list. **Path** **Query** The longitude of a charging location from [`GET Charge Schedule by Location`](/api-reference/ford/get-charge-schedule-by-location) The latitude of a charging location from [`GET Charge Schedule by Location`](/api-reference/ford/get-charge-schedule-by-location) **Body** The maximum charge limit for the vehicle at the location as a percent between `0.5` and `1`. The weekday and weekend charging schedules for the vehicle at the location. The charging schedule for the vehicle on weekdays (Monday - Friday). The exact hour a vehicle should start charging in HH:00 e.g. 17:00. The exact hour a vehicle should stop charging in HH:00 e.g. 21:00. The charging schedule for the vehicle on weekends (Saturday - Sunday). The exact hour a vehicle should start charging in HH:00 e.g. 17:00. The exact hour a vehicle should stop charging in HH:00 e.g. 21:00. ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/schedule_by_location?longitude=2.3522&latitude=48.8566" \ -H "Authorization: Bearer {token}" \ -X "PUT" \ -H "Content-Type: application/json" \ -d '{chargingLocation:{"chargeLimit": 0.9, "chargingWindows": {"weekday": [{"start": "09:00", "end": "17:00"}], "weekend": [{"start": "09:00", "end": "17:00"}]}}}' ``` ```python Python setChargeScheduleByLocation = vehicle.request( "PUT", "{make}/charge/schedule_by_location?longitude=2.3522&latitude=48.8566", { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [ { "start": "09:00", "end": "10:00" } ], "weekend": [ { "start": "09:00", "end": "10:00" } ] } } } ) ``` ```js Node const setChargeScheduleByLocation = vehicle.request( "PUT", "{make}/charge/schedule_by_location?longitude=2.3522&latitude=48.8566", { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [ { "start": "09:00", "end": "10:00" } ], "weekend": [ { "start": "09:00", "end": "10:00" } ] } } } ); ``` ```java Java JsonArrayBuilder weekday = Json.createArrayBuilder().add( Json.createObjectBuilder().add("start", "05:00").add("end", "07:00")); JsonArrayBuilder weekend = Json.createArrayBuilder().add( Json.createObjectBuilder().add("start", "06:00").add("end", "07:00")); JsonObject chargingWindows = Json.createObjectBuilder() .add("weekday", weekday) .add("weekend", weekend) .build(); JsonObject chargingLocation = Json.createObjectBuilder() .add("chargeLimit", 1.0) .add("chargingWindows", chargingWindows) .build(); SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("PUT") .path("ford/charge/schedule_by_location") .addQueryParameter("latitude", "37.749008") .addQueryParameter("longitude", "-122.46981") .addBodyParameter("chargingLocation", chargingLocation) .build(); VehicleResponse chargeSched = vehicle.request(request); ``` ```ruby Ruby setChargeScheduleByLocation = vehicle.request( "PUT", "{make}/charge/schedule_by_location?longitude=2.3522&latitude=48.8566", { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [ { "start": "09:00", "end": "10:00" } ], "weekend": [ { "start": "09:00", "end": "10:00" } ] } } } ) ``` ## Response If the request is successful, Smartcar will return a message. If the request is successful, Smartcar will return `success`. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` ## Example Request Bodies ```json { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [ { "start": "17:00", "end": "06:00" } ], "weekend": [ { "start": "16:00", "end": "07:00" } ] } } } ``` ```json { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [ { "start": "17:00", "end": "06:00" } ], "weekend": [] } } } ``` ```json { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [], "weekend": [ { "start": "16:00", "end": "07:00" } ] } } } ``` ```json { "chargingLocation" : { "chargeLimit": 0.9, "chargingWindows": { "weekday": [], "weekend": [] } } } ``` # Diagnostic Trouble Codes Source: https://smartcar.com/docs/api-reference/get-dtcs GET /vehicles/{id}/diagnostics/dtcs Provides a list of active Diagnostic Trouble Codes (DTCs) reported by the vehicle. Currently supporting GM brands including Chevrolet and GMC. ## Permission `read_diagnostics` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/diagnostics/dtcs" \\ -H "Authorization: Bearer {token}" \\ -X "GET" ``` ```python Python diagnostic_trouble_codes = vehicle.diagnostic_trouble_codes() ``` ```js Node const diagnosticTroubleCodes = await vehicle.diagnosticTroubleCodes(); ``` ```java Java VehicleDiagnosticTroubleCodes diagnosticTroubleCodes = vehicle.diagnosticTroubleCodes(); ``` ```ruby Ruby diagnostic_trouble_codes = vehicle.diagnostic_trouble_codes ``` ## Request **Path** ## Response The Diagnostic Trouble Code reported by the vehicle. The date and time the troublecode last became active. ```json Example Response { "activeCodes": [ { "code": "P302D", "timestamp": "2024-09-05T14:48:00.000Z" }, { "code": "xxxxx", "timestamp": null }, ... ] } ``` # Oil Life Source: https://smartcar.com/docs/api-reference/get-engine-oil-life GET /vehicles/{id}/engine/oil Returns the remaining life span of a vehicle’s engine oil. ## Permission `read_engine_oil` ## Request **Path** ## Response The engine oil’s remaining life span based on the current quality of the oil as a percentage. `1` indicates the oil was changed recently and `0` indicates the oil should be changed immediately. It is not a representation of how much oil is left in the vehicle. ```json Example Response { "lifeRemaining": 0.35 } ``` # Fuel Tank Source: https://smartcar.com/docs/api-reference/get-fuel-tank GET /vehicles/{id}/fuel Returns the status of the fuel remaining in the vehicle’s fuel tank. ## Permission `read_fuel` This endpoint may return `null` values for vehicles sold in Europe. Please see the [Notes](/api-reference/get-fuel-tank#notes) section for details. ## Request **Path** ## Response The remaining level of fuel in the tank as a percentage. The amount of fuel in the tank. The estimated remaining distance the car can travel. ```json Example Response { "amountRemaining": 53.2, "percentRemaining": 0.3, "range": 40.5 } ``` ## Notes The table below indicates values Smartcar attempts to retrieve from vehicles sold in Europe. | | `range` | `percentRemaining` | `amountRemaining` | | ------------------------------------ | ------- | ------------------ | ----------------- | | Audi | ✅ | ✅ | | | BMW, MINI | ✅ | ✅ | ✅ | | Citroen, DS, Opel, Peugeot, Vauxhall | ✅ | | ✅ | | Ford | ✅ | ✅ | | | Hyundai | ✅ | | ✅ | | Jaguar, Land Rover | ✅ | ✅ | | | Kia | ✅ | ✅ | | | Mazda | ✅ | ✅ | | | Mercedes | ✅ | ✅ | | | Renault | ✅ | | ✅ | | Skoda, Volkswagen | ✅ | ✅ | | | Volvo | ✅ | ✅ | ✅ | # Location Source: https://smartcar.com/docs/api-reference/get-location GET /vehicles/{id}/location Returns the vehicle's last known location. ## Permission `read_location` ## Request **Path** ## Response The latitude in degrees. The longitude in degrees. ```json Example Response { "latitude": 37.4292, "longitude": 122.1381 } ``` # Lock Status Source: https://smartcar.com/docs/api-reference/get-lock-status GET /vehicles/{id}/security Returns the lock status for a vehicle and the open status of its doors, windows, storage units, sunroof and charging port where available. ## Permission `read_security` ## Request **Path** ## Response Indicates the current lock status of the vehicle as reported by the OEM. An array of the open status of the vehicle's doors. The location of the door. Indicates the current state of the vehicle's door. `UNKNOWN` indicates the vehicle supports this status, but did not provide a valid status for the request An array of the open status of the vehicle's windows. The location of the window. Indicates the current state of the vehicle's window. `UNKNOWN` indicates the vehicle supports this status, but did not provide a valid status for the request An array of the open status of the vehicle's sunroofs. The location of the sunroof. Indicates the current state of the vehicle's sunroof. `UNKNOWN` indicates the vehicle supports this status, but did not provide a valid status for the request An array of the open status of the vehicle's storages. For internal combustion and plug-in hybrid vehicles front refers to the engine hood. For battery vehicles, this will be the front trunk. The location of the sunroof. Indicates the current state of the vehicle's storage. `UNKNOWN` indicates the vehicle supports this status, but did not provide a valid status for the request An array of the open status of the vehicle's charging port. The location of the charging port. Indicates the current state of the vehicle's charging port. `UNKNOWN` indicates the vehicle supports this status, but did not provide a valid status for the request ```json Example Response { "isLocked" : false, "doors" : [ {"type": "frontLeft" , "status" : "CLOSED"}, {"type": "frontRight" , "status" : "OPEN"}, {"type": "backRight" , "status" : "CLOSED"}, {"type": "backLeft" , "status" : "CLOSED"} ], "windows" : [ {"type": "frontLeft" , "status" : "CLOSED"}, {"type": "frontRight" , "status" : "CLOSED"}, {"type": "backRight" , "status" : "UNKNOWN"}, {"type": "backLeft" , "status" : "CLOSED"} ], "sunroof" : [ {"type": "sunroof" , "status" : "CLOSED"} ], "storage" : [ {"type": "rear" , "status" : "UNKNOWN"}, {"type": "front" , "status" : "CLOSED"} ], "chargingPort" : [ {"type" : "chargingPort", "status" : "CLOSED" } ] } ``` # Notes * The open status array(s) will be empty if a vehicle has partial support. * The request will error if `lockStatus` can not be retrieved from the vehicle or the brand is not supported. # Battery Capacity Source: https://smartcar.com/docs/api-reference/get-nominal-capacity GET /vehicles/{id}/battery/nominal_capacity Returns a list of nominal rated battery capacities for a vehicle. This endpoint is only available for US and European based vehicles. Please refer to [this page](/api-reference/evs/get-battery-capacity) if you need battery capacity for Canadian based vehicles for the time being. ## Permission `read_battery` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/battery/nominal_capacity" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ## Response An array of capacites Objects. The rated nominal capacity for the vehicle's battery. A a description of the uniquness for the nominal capacity and engine type of the vehicle in the form `{ENGINE_TYPE}:{TRIM}`, for example `"BEV:Extended Range"`. Engine type can be one of `BEV` or `PHEV`. The rated nominal capacity for the vehicle's battery. Indicates if this capacity was determined by a user or Smartcar. Options are `USER_SELECTED` or `SMARTCAR`. A URL that will launch the flow for a vehicle owner to specify the correct battery capacity for a vehicle. **Please to ensure you append a redirect URI** for us to send a response to once the user exits the flow. Please see [this article](/connect/user-selected-batcap) on how to handle the URL callback. ```json Response Example { "availableCapacities": [ { "capacity" : 70.9, "description" : null }, { "capacity" : 80.9, "description" : null }, { "capacity" : 90.9, "description" : "BEV:Extended Range" } ], "capacity": { "nominal" : 80.9, "source": "USER_SELECTED" }, "url" : "https://connect.smartcar.com/battery-capacity?vehicle_id=36ab27d0-fd9d-4455-823a-ce30af709ffc&client_id=8229df9f-91a0-4ff0-a1ae-a1f38ee24d07&token=90abecb6-e7ab-4b85-864a-e1c8bf67f2ad&response_type=vehicle_id&redirect_uri=" } ``` ### Case 1: Smartcar has determined the battery capacity ```json Single capacity { "availableCapacities": [ { "capacity" : 70.9, "description" : null } ], "capacity": { "nominal" : 70.9, "source": "SMARTCAR" }, "url" : null } ``` ### Case 2: Unable to determine the battery capacity ```json Multiple capacites { "availableCapacities": [ { "capacity" : 70.9, "description" : null }, { "capacity" : 80.9, "description" : null }, { "capacity" : 90.9, "description" : "BEV:Extended Range" } ], "capacity": null, "url" : "https://connect.smartcar.com/battery-capacity?vehicle_id=36ab27d0-fd9d-4455-823a-ce30af709ffc&client_id=8229df9f-91a0-4ff0-a1ae-a1f38ee24d07&token=90abecb6-e7ab-4b85-864a-e1c8bf67f2ad&response_type=vehicle_id&redirect_uri=" } ``` ### Case 3: User selected battery capacity Smartcar will sometimes return an `availableCapacities` object along side a Connect URL you can use to prompt users to select the battery capacity of their vehicle. This can occur when an accurate match could not be found, or vehicle owners purchased extension packs, or software upgrades specific to their vehicle. When you recirect a vehicle owner to this Smartcar Connect url, they can select the battery capacity of their vehicle for cases where the battery capacity cannot be accurately deteremined. When a user selects an option, Smartcar will return this value with `USER_SELECTED` as the source. ```json Multiple capacites { "availableCapacities": [ { "capacity" : 70.9, "description" : null }, { "capacity" : 80.9, "description" : null }, { "capacity" : 90.9, "description" : "BEV:Extended Range" } ], "capacity": { "nominal" : 80.9, "source": "USER_SELECTED" }, "url" : "https://connect.smartcar.com/battery-capacity?vehicle_id=36ab27d0-fd9d-4455-823a-ce30af709ffc&client_id=8229df9f-91a0-4ff0-a1ae-a1f38ee24d07&token=90abecb6-e7ab-4b85-864a-e1c8bf67f2ad&response_type=vehicle_id&redirect_uri=" } ``` # Odometer Source: https://smartcar.com/docs/api-reference/get-odometer GET /vehicles/{id}/odometer Returns the vehicle’s last known odometer reading. ## Permission `read_odometer` ## Request **Path** ## Response The current odometer of the vehicle. ```json Example Response { "distance": 104.32 } ``` # Service History Source: https://smartcar.com/docs/api-reference/get-service-records GET /vehicles/{id}/service/history Retrieve service records tracked by the vehicle's dealer or manually added by the vehicle owner. Currently supporting Ford, Lincoln, Toyota, Lexus, Mazda and Volkswagen (US) ## Permission `read_service_history` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/service/history \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python service = vehicle.request( "GET", "service/history" ) ``` ```js Node const service = await vehicle.request( "GET", "service/history" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("service/history") .build(); VehicleResponse service =vehicle.request(request); ``` ```ruby Ruby Service = vehicle.request( "GET", "service/history" ) ``` ## Request **Path** ## Response A unique identifier of the service record. The date and time the vehicle was serviced the odometer of the vehicle at time of service in kilometers. The unique identifier of the tasks completed as part of the service event. Tasks completed as part of the service event. Note that not all makes provide service tasks. Additional service details. Indicates if the service event was completed by a dealership or manually entered by the vehicle owner. An overview of service costs. The total cost of the service event. Note that not all makes provide service cost. Identifies the currency used for service cost. ```json Example Response { "serviceId": null, "odometerDistance": 46047.22, "serviceDate": "2023-06-28T22:21:41.583Z", "serviceTasks": [ { "taskId": "3262", "taskDescription": "Service Task 0" }, { "taskId": "3041", "taskDescription": null }, { "taskId": null, "taskDescription": null } ], "serviceDetails": [ { "type": "Service Details Type 0", "value": "Service Details Value 0" }, { "type": "Service Details Type 1", "value": null } ], "serviceCost": { "totalCost": null, "currency": null } } ``` # System Status Source: https://smartcar.com/docs/api-reference/get-system-status GET /vehicles/{id}/diagnostics/system_status Provides a list of vehicle systems and their current health status. Currently supporting FCA and GM brands including RAM, Jeep, Chrysler, Dodge, Fiat, Alpha Romeo, Buick, Cadillac, Chevrolet and GMC. See [Diagnostic Systems](/docs/help/diagnostic-systems) for a complete list of Smartcar System IDs. ## Permission `read_diagnostics` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/diagnostics/system_status" \\ -H "Authorization: Bearer {token}" \\ -X "GET" ``` ```python Python diagnostic_system_status = vehicle.diagnostic_system_status() ``` ```js Node const diagnosticSystemStatus = await vehicle.diagnosticSystemStatus(); ``` ```java Java VehicleDiagnosticSystemStatus diagnosticSystemStatus = vehicle.diagnosticSystemStatus(); ``` ```ruby Ruby diagnostic_system_status = vehicle.diagnostic_system_status ``` ## Request **Path** ## Response An overview of systems reported by the vehicle. The unique identifier of a system reported by the vehicle. The status of a vehicle, expected as "OK" or "ALERT". A plain-text description of the status, if available. ```json Example Response { "systems": [ { // System ID from Smartcar unified system definition list "systemId": "SYSTEM_TPMS", "status": "ALERT", "description": "Left rear tire sensor battery low" }, { "systemId": "SYSTEM_AIRBAG", "status": "OK", "description": null }, { "systemId": "SYSTEM_MIL", "status": "OK", "description": null }, ... ] } ``` # Tire Pressure Source: https://smartcar.com/docs/api-reference/get-tire-pressure GET /vehicles/{id}/tires/pressure Returns the air pressure of each of the vehicle’s tires. ## Permission `read_tires` ## Request **Path** ## Response The current air pressure of the front left tire. The current air pressure of the front right tire. The current air pressure of the back left tire. The current air pressure of the back right tire. ```json Example Response { "backLeft": 219.3, "backRight": 219.3, "frontLeft": 219.3, "frontRight": 219.3 } ``` # Vehicle Attributes Source: https://smartcar.com/docs/api-reference/get-vehicle-info GET /vehicles/{id} Returns a single vehicle object, containing identifying information. ## Permission `read_vehicle_info` ## Request **Path** ## Response The ID for the vehicle. The manufacturer of the vehicle. The model of the vehicle. The model year. ```json Example Response { "id": "36ab27d0-fd9d-4455-823a-ce30af709ffc", "make": "TESLA", "model": "Model S", "year": "2014" } ``` # VIN Source: https://smartcar.com/docs/api-reference/get-vin GET /vehicles/{id}/vin Returns the vehicle’s manufacturer identifier. ## Permission `read_vin` ## Request **Path** ## Response The manufacturer unique identifier. ```json Example Response { "vin": "5YJSA1CN5DFP00101" } ``` # Charge Completion Time Source: https://smartcar.com/docs/api-reference/gm/get-charge-completion-time GET /vehicles/{id}/{make}/charge/completion When the vehicle is charging, returns the date and time the vehicle expects to "complete" this charging session. When the vehicle is not charging, this endpoint results in a vehicle state error. This endpoint is currently available for `cadillac` and `chevrolet`. ## Permission `read_charge` ## Request `vehicle_id` of the vehicle you are making the request to. The make to pass in the URL. ## Response An ISO8601 formatted datetime (`YYYY-MM-DDTHH:mm:ss.SSSZ`) for the time at which the vehicle expects to complete this charging session. ```json Example Response { "time": "2022-01-13T22:52:55.358Z" } ``` # Voltage Source: https://smartcar.com/docs/api-reference/gm/get-charge-voltmeter GET /vehicles/{id}/{make}/charge/voltmeter When the vehicle is plugged in, returns the charging voltage measured by the vehicle. When the vehicle is not plugged in, this endpoint results in a vehicle state error. This endpoint is currently available for `cadillac` and `chevrolet`. ## Permission `read_charge` ## Request ## Response The potential difference measured by the vehicle in volts (V). ```json Example Response { "voltage": 240 } ``` # Headers Source: https://smartcar.com/docs/api-reference/headers Smartcar uses the following headers for requests and responses. ## Request Smartcar supports both `metric` and `imperial` unit systems of measurement. ```curl Request Headers SC-Unit-System: metric ``` ## Response Indicates the timestamp (ISO-8601 format) of when the returned data was recorded by the vehicle. Indicates the timestamp (ISO-8601 format) of when Smartcar fetched the data from the OEM. Indicates whether the unit system used in the returned data is `imperial` or `metric`. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. ```curl Response Headers SC-Data-Age: 2018-06-20T01:33:37.078Z SC-Fetched-At: 2018-06-20T01:48:37.078Z SC-Unit-System: metric SC-Request-Id: 26c14915-0c26-43c5-8e42-9edfc2a66a0f ``` # Smartcar API Reference Source: https://smartcar.com/docs/api-reference/intro Welcome to Smartcar! Here you’ll find everything you need to get started with Smartcar. If you have any questions, please email us at [support@smartcar.com](mailto:support@smartcar.com)! Smartcar makes it easy to read vehicle data and send commands to vehicles of any brand using HTTP requests. All requests made to our API require an access token. Our API uses the OAuth2 authorization framework and provides a granular permissioning system that authorizes API endpoints based on user preferences. This allows applications to easily authorize and interact with vehicles through the Smartcar API. Easily connect a vehicle and make API requests using our starter app. Get a feel for the API using our Postman collection. # Makes Source: https://smartcar.com/docs/api-reference/makes Valid values for the `make` parameter #### United States | | | | | | | | | ---------- | ----------- | ---------- | --------------- | --------- | ------------ | - | | `ACURA` | `CHEVROLET` | `HYUNDAI` | `LAND_ROVER` | `MINI` | `SUBARU` | | | `AUDI` | `CHRYSLER` | `INFINITI` | `LEXUS` | `NISSAN` | `TESLA` | | | `BMW` | `DODGE` | `JAGUAR` | `LINCOLN` | `PORSCHE` | `TOYOTA` | | | `BUICK` | `FORD` | `JEEP` | `MAZDA` | `RAM` | `VOLKSWAGEN` | | | `CADILLAC` | `GMC` | `KIA` | `MERCEDES_BENZ` | `RIVIAN` | `VOLVO` | | #### Europe | | | | | | | ------------ | --------- | --------------- | --------- | ------------ | | `AUDI` | `DS` | `KIA` | `NISSAN` | `SKODA` | | `ALFA_ROMEO` | `FIAT` | `LAND_ROVER` | `OPEL` | `TESLA` | | `BMW` | `FORD` | `MAZDA` | `PEUGEOT` | `VAUXHALL` | | `CITROEN` | `JAGUAR` | `MERCEDES_BENZ` | `PORSCHE` | `VOLKSWAGEN` | | `CUPRA` | `HYUNDAI` | `MINI` | `RENAULT` | `VOLVO` | See [this](https://smartcar.com/global/) page for supported countries. #### Canada | | | | | | | ---------- | ----------- | ------------ | --------- | -------- | | `ACURA` | `CHEVROLET` | `HYUNDAI` | `LEXUS` | `TOYOTA` | | `AUDI` | `CHRYSLER` | `JAGUAR` | `LINCOLN` | `VOLVO` | | `BMW` | `DODGE` | `JEEP` | `MINI` | | | `BUICK` | `FORD` | `KIA` | `RAM` | | | `CADILLAC` | `GMC` | `LAND_ROVER` | `TESLA` | | # Vehicle Connections Source: https://smartcar.com/docs/api-reference/management/delete-vehicle-connections DELETE https://management.smartcar.com/v2.0/management/connections Deletes all vehicle connections associated with a Smartcar user ID or a specific vehicle. ## Request **Header** In the format `Basic base64(default:{application_management_token})`. You can find your `application_management_token` under your Application Configuration in the Smartcar Dashboard. **Query** Delete a connection for the given `vehicle_id` or all vehicle connections for the given `user_id`. ## Response An array of connections ID of the user that authorized the deleted connection (UUID v4) ID of the vehicle disconnected (UUID v4) # Vehicle Connections Source: https://smartcar.com/docs/api-reference/management/get-vehicle-connections GET https://management.smartcar.com/v2.0/management/connections Returns a paged list of all vehicles that are connected to the application associated with the management API token used, sorted in descending order by connection date. ## Request **Header** In the format `Basic base64(default:{application_management_token})`. You can find your `application_management_token` under your Application Configuration in the Smartcar Dashboard. **Query** Number of connections to return per page. `Max: 100` Used for accessing pages other than the first page. Each page returned has a cursor value that can be passed here to fetch the “next” page. Filter for connections created by the provider user ID. Filter for connections to the provided vehicle ID. Filter for connections by either `live`, `simulated`, or the deprecated `test` mode. ## Response An array of connections ID of the user that authorized this connection (UUID v4). ID of the vehicle connected (UUID v4). Time at which the connection was created in UTC. Vehicle mode: live, simulated, or test (deprecated). Metadata about the current query The cursor parameter that should be used to fetch the next page of results. This field will be null if there are no more pages. # Charge Schedule Source: https://smartcar.com/docs/api-reference/nissan/get-charge-schedule GET /vehicles/{id}/{make}/charge/schedule Returns the charging schedule of a vehicle. The response contains the start time and departure time of the vehicle's charging schedule. This endpoint is currently available for `nissan` EVs on the `MyNISSAN` platform. ## Permission `read_charge` ## Request **Path** ## Response An array of charge schedules. Maximum of 3 schedules, empty if no schedules are set. HH:mm in UTC for a schedule start time. HH:mm in UTC for a schedule end time. An array of days the schedule applies to. ```json Example Response { "chargeSchedules": [ { "end": "2020-01-01T02:00:00.000Z", "start": "2020-01-01T01:00:00.000Z", "days": [ "MONDAY", "WEDNESDAY", "FRIDAY" ] } ] } ``` # Charge Schedule Source: https://smartcar.com/docs/api-reference/nissan/set-charge-schedule PUT /vehicles/{id}/{make}/charge/schedule Sets the charging schedule for a vehicle. This endpoint is currently available for `nissan` EVs on the `MyNISSAN` platform ## Permission `control_charge` ## Request **Path** **Body** An array of charge schedules. A maximum of 3 schedules can be set. HH:mm in UTC for a schedule start time. HH:mm in UTC for a schedule start time. An array of days for the schedule to be applied. Options: `MONDAY` `TUESDAY` `WEDNESDAY` `THURSDAY` `FRIDAY` `SATURDAY` `SUNDAY` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/schedule" \ -H "Authorization: Bearer {token}" \ -X "PUT" \ -H "Content-Type: application/json" \ -d '{ "chargeSchedules": [ { "start": "08:00", "end": "12:00", "days": ["MONDAY", "WEDNESDAY", "FRIDAY"] }, { "start": "14:00", "end": "18:00", "days": ["TUESDAY", "THURSDAY", "SATURDAY"] } ] }' ``` ```python Python charge_schedule = vehicle.request("PUT", "{make}/charge/schedule", { "chargeSchedules": [ { "start": "08:00", "end": "12:00", "days": ["MONDAY", "WEDNESDAY", "FRIDAY"] }, { "start": "14:00", "end": "18:00", "days": ["TUESDAY", "THURSDAY", "SATURDAY"] } ] }) ``` ```js Node const chargeSchedule = vehicle.request("PUT", "{make}/charge/schedule", { "chargeSchedules": [ { "start": "08:00", "end": "12:00", "days": ["MONDAY", "WEDNESDAY", "FRIDAY"] }, { "start": "14:00", "end": "18:00", "days": ["TUESDAY", "THURSDAY", "SATURDAY"] } ] }); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("PUT") .path("{make}/charge/schedule") .addBodyParameter("chargeSchedules", [ { "start": "08:00", "end": "12:00", "days": ["MONDAY", "WEDNESDAY", "FRIDAY"] }, { "start": "14:00", "end": "18:00", "days": ["TUESDAY", "THURSDAY", "SATURDAY"] } ]) .build(); ChargeSchedule chargeSchedule = vehicle.request(request); ``` ```ruby Ruby charge_schedule = vehicle.request("PUT", "{make}/charge/schedule", { "chargeSchedules": [ { "start": "08:00", "end": "12:00", "days": ["MONDAY", "WEDNESDAY", "FRIDAY"] }, { "start": "14:00", "end": "18:00", "days": ["TUESDAY", "THURSDAY", "SATURDAY"] } ] }) ``` ## Response If the request is successful, Smartcar will return a message. If the request is successful, Smartcar will return `success`. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Permissions Source: https://smartcar.com/docs/api-reference/permissions In order to use an endpoint or webhook, you'll need to request the associated permissions from your user in [Connect](/docs/connect/what-is-connect). A permission is *optional* by default. This means that if you were to pass `read_fuel` in your Connect URL and the user tried to connect a Tesla, the permission would not show up as Tesla does not support fuel. It can be made required by adding the `required:` prefix to the permission name, e.g. `required:read_fuel`. In this case, if a user were to try and connect a Tesla they'd see a `No Compatible Vehicles` Connect error as your application is requiring vehicles to have the `read_fuel` permission. In Europe, permissions can be conditional meaning that even if the `required:` prefix is provided, a vehicle can make it through Connect as we cannot be sure of a vehicle's capability until you attempt to make an API request. In this case you'll receive a [VEHICLE\_NOT\_CAPABLE](/errors/api-errors/compatibility-errors#vehicle-not-capable) API error. To read more about capabilities please see [Compatibility by VIN](/api-reference/compatibility/by-vin). ## Read Permissions prefixed with `read_` allow your application to get data from a vehicle as part of `GET` requests. | | | | ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `read_alerts` | Read alerts from the vehicle | | `read_battery` | Read an EV's high voltage battery data | | `read_charge` | Read charging data | | `read_charge_locations` | Access previous charging locations and their associated charging configurations | | `read_charge_records` | Read charge records and associated billing information | | `read_charge_events` | Receive notifications for events associate with charging | | `read_climate` | Read the status and settings of the vehicle's climate control system | | `read_compass` | Read the compass direction the vehicle is facing | | `read_diagnostics` | Read a vehicle's system status and/or Diagnostic Trouble Codes | | `read_engine_oil` | Read vehicle engine oil health | | `read_extended_vehicle_info` | Read vehicle configuration information from a vehicle | | `read_fuel` | Read fuel tank level | | `read_location` | Access the vehicles location | | `read_odometer` | Retrieve total distance traveled | | `read_security` | Read the lock status of doors, windows, charging port, etc. | | `read_service_history` | Read a vehicle's dealer service history | | `read_speedometer` | Read a vehicle's speed | | `read_thermometer` | Read temperatures from inside and outside the vehicle | | `read_tires` | Read a vehicle's tire status | | `read_user_profile` | Read the information associated with a users connected services account profile such as their email and phone number. | | `read_vehicle_info` | Know make, model, and year | | `read_vin` | Read VIN | ## Control Permissions prefixed with `control_` allow your application to issue commands or apply settings to a vehicle as part of `POST` or `PUT` requests. | | | | -------------------- | ------------------------------------------------------------------- | | `control_charge` | Control a vehicle's charge state | | `control_climate` | Set the status and settings of the vehicle's climate control system | | `control_navigation` | Send commands to the vehicle's navigation system | | `control_security` | Lock or unlock the vehicle | | `control_pin` | Modify a PIN and enable the PIN to Drive feature for the vehicle. | | `control_trunk` | Open a vehicle's trunk or frunk | # Send Destination Source: https://smartcar.com/docs/api-reference/send-destination-to-vehicle POST /vehicles/{id}/navigation/destination Send destination coordinates to the vehicle's navigation system. ## Permission `control_navigation` ## Request **Path** **Body** The latitude of the location you wish to set the vehicle's navigation to. The longitude of the location you wish to set the vehicle's navigation to. ## Response If the request is successful, Smartcar will return “success” (HTTP 200 status). If the request is successful, Smartcar will return a message (HTTP 200 status). ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Clear PIN to Drive Source: https://smartcar.com/docs/api-reference/tesla/clear-pin-to-drive DELETE /vehicles/{id}/{make}/pin Disables this feature on the vehicle and resets the PIN. ## Permission `control_pin` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/pin" \ -H "Authorization: Bearer {token}" \ -X "DELETE" \ -H "Content-Type: application/json" \ ``` ```python Python pin = vehicle.request( "DELETE", "{make}/pin" ) ``` ```js Node const pin = vehicle.request( "DELETE", "{make}/pin" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("DELETE") .path("{make}/pin") .build(); VehicleResponse pin = vehicle.request(request); ``` ```ruby Ruby pin = vehicle.request( "DELETE", "{make}/pin" ) ``` ## Response If the request is successful, Smartcar will return “success”. If the request is successful, Smartcar will return a message. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` ## Notes * Call `POST` [PIN to Drive](/api-reference/tesla/set-pin-to-drive) in order to enable this feature and set the PIN * Currently both owner and driver account types can clear a PIN for the vehicle and disable the feature via the API. # Charge Port Source: https://smartcar.com/docs/api-reference/tesla/control-charge-port POST /vehicles/{id}/{make}/charge/charge_port_door Open or close the vehicle's charge port door. ## Permission `control_charge` ## Request **Path** **Body** Indicate whether to open or close the charge port door. Options: `OPEN` or `CLOSE` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/charge_port_door" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"action" : "OPEN"}' ``` ```python Python charge_port = vehicle.request( "POST", "{make}/charge/charge_port_door", {"action" : "OPEN"} ) ``` ```js Node const chargePort = vehicle.request( "POST", "{make}/charge/charge_port_door", {"action" : "OPEN"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/charge/charge_port_door") .addBodyParameter("action" : "OPEN") .build(); VehicleResponse chargePort = vehicle.request(request); ``` ```ruby Ruby charge_port = vehicle.request( "POST", "{make}/charge/charge_port_door", {"action" : "OPEN"} ) ``` ## Response If the request is successful, Smartcar will return “success”. If the request is successful, Smartcar will return a message. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Frunk Source: https://smartcar.com/docs/api-reference/tesla/control-frunk POST /vehicles/{id}/{make}/security/frunk Open or close the frunk (front trunk) of the Tesla vehicle. ## Permission `control_trunk` ## Request **Path** **Body** Indicate whether to open or close the charge port door. Options: `OPEN` or `CLOSE` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/security/frunk" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"action" : "OPEN"}' ``` ```python Python frunk = vehicle.request( "POST", "{make}/security/frunk", {"action" : "OPEN"} ) ``` ```js Node const frunk = vehicle.request( "POST", "{make}/security/frunk", {"action" : "OPEN"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/security/frunk") .addBodyParameter("action" : "OPEN") .build(); VehicleResponse frunk = vehicle.request(request); ``` ```ruby Ruby frunk = vehicle.request( "POST", "{make}/security/frunk", {"action" : "OPEN"} ) ``` ## Response If the request is successful, Smartcar will return “success”. If the request is successful, Smartcar will return a message. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Trunk Source: https://smartcar.com/docs/api-reference/tesla/control-trunk POST /vehicles/{id}/{make}/security/trunk Open or close the trunk of the Tesla vehicle. ## Permission `control_trunk` ## Request **Path** **Body** Indicate whether to open or close the charge port door. Options: `OPEN` or `CLOSE` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/security/trunk" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"action" : "OPEN"}' ``` ```python Python trunk = vehicle.request( "POST", "{make}/security/trunk", {"action" : "OPEN"} ) ``` ```js Node const trunk = vehicle.request( "POST", "{make}/security/trunk", {"action" : "OPEN"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/security/trunk") .addBodyParameter("action" : "OPEN") .build(); VehicleResponse trunk = vehicle.request(request); ``` ```ruby Ruby trunk = vehicle.request( "POST", "{make}/security/trunk", {"action" : "OPEN"} ) ``` ## Response If the request is successful, Smartcar will return “success”. If the request is successful, Smartcar will return a message. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` # Alerts Source: https://smartcar.com/docs/api-reference/tesla/get-alerts GET /vehicles/{id}/{make}/alerts Returns recent alerts from the vehicle. ## Permission `read_alerts` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/alerts" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python alerts = vehicle.request( "GET", "{make}/alerts" ) ``` ```js Node const alerts = await vehicle.request( "GET", "{make}/alerts" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/alerts") .build(); VehicleResponse alerts =vehicle.request(request); ``` ```ruby Ruby alerts = vehicle.request( "GET", "{make}/alerts" ) ``` ## Request **Path** ## Response The name of the alert. Date and time of the alert. Indicates recipients of the alert. Additional context related to the alert. ```json Example Response { "alerts" : [ { "name": "Name_Of_The_Alert", "dateTime": "2022-07-10T16:20:00.000Z", "audience": [ "service-fix", "customer" ], "userText": "additional description text" } ] } ``` # Tesla: Battery Status Source: https://smartcar.com/docs/api-reference/tesla/get-battery GET /vehicles/{id}/{make}/battery Returns all battery related data for a Tesla vehicle. The following fields are not supported for streaming vehicles: * TeslaBatteryPercentRemainingUsable * TeslaBatteryMaxRangeChargeCounter ## Permission `read_battery` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/battery" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python battery = vehicle.request( "GET", "{make}/battery" ) ``` ```js Node const battery = await vehicle.request( "GET", "{make}/battery" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/battery") .build(); VehicleResponse battery = vehicle.request(request); ``` ```ruby Ruby battery = vehicle.request( "GET", "{make}/battery" ) ``` ## Request **Path** ## Response The EV’s state of charge as a percentage. The distance the vehicle can travel powered by it’s high voltage battery. Indicates if the battery heater is on. The estimated remaining distance the vehicle can travel powered by it’s high voltage battery as determined by Tesla. The ideal remaining distance the vehicle can travel powered by it’s high voltage battery as determined by Tesla. The EV’s useable state of charge as a percentage as reported by Tesla. The number of times the vehicle has been charged to 100% as reported by Tesla. Indicates if there is enough power to heat the battery. ```json Example Response { "heaterOn": null, "maxRangeChargeCounter" : null, "notEnoughPowerToHeat" : true, "percentRemaining": 0.3, "percentRemainingUsable" : 0.29, "range": 40.5, "rangeEstimated": 39.01, "rangeIdeal" : 40.5 } ``` # Cabin Climate Source: https://smartcar.com/docs/api-reference/tesla/get-cabin GET /vehicles/{id}/{make}/climate/cabin Returns the current state and target temperature setting of a vehicle's cabin climate system. ## Permission `read_climate` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/climate/cabin" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python cabin = vehicle.request( "GET", "{make}/climate/cabin" ) ``` ```js Node const chargeCompletion = await vehicle.request( "GET", "{make}/climate/cabin" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/climate/cabin") .build(); VehicleResponse chargeCompletion = vehicle.request(request); ``` ```ruby Ruby chargeCompletion = vehicle.request( "GET", "{make}/climate/cabin" ) ``` ## Response The current state of the climate cabin system. The target temperature setting of the vehicle when the climate system is on (in Celsius by default or in Fahrenheit using the sc-unit-system). ```json Example Response { "status": "ON", "temperature": 20 } ``` # Tesla: Charge Status Source: https://smartcar.com/docs/api-reference/tesla/get-charge GET /vehicles/{id}/{make}/charge Returns all charging related data for a Tesla vehicle. The following fields are not supported for streaming vehicles: * TeslaChargeRangeAddedRated * TeslaChargeRangeAddedIdeal * TeslaChargeChargeRate * TeslaChargeAmperageMaxCharger * TeslaChargeChargePortColor ## Permission `read_charge` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python charge = vehicle.request( "GET", "{make}/charge" ) ``` ```js Node const charge = await vehicle.request( "GET", "{make}/charge" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/charge") .build(); VehicleResponse charge = vehicle.request(request); ``` ```ruby Ruby charge = vehicle.request( "GET", "{make}/charge" ) ``` ## Request **Path** ## Response The rate that the vehicle is charging at (in amperes). An ISO8601 formatted datetime (YYYY-MM-DDTHH:mm:ss.SSSZ) for the time at which the vehicle expects to complete this charging session. The instant power measured by the vehicle (in kilowatts). Indicates if the vehicle is plugged in Indicates the charging status of the vehicle Indicates the level at which the vehicle will stop charging and be considered fully charged as a percentage. Indicates the max amperage the vehicle can request from the charger. Indicates the max SoC limit that can be set. Indicates the min SoC limit that can be set. Indicates the default SoC limit of the vehicle. Indicates the amperage requested from the charger by the vehicle. Energy added in the current charging session or most recent session if the vehicle is not charging (in kilowatts). The rated range as determined by Tesla added in the current charging session or most recent session if the vehicle is not charging (in kilometers added). The ideal range as determined by Tesla added in the current charging session or most recent session if the vehicle is not charging (in kilometers added). The rate of range added in the charging session (in kilometers added / hour). Standard of the connector e.g. SAE When charging, indicates if the vehicle connected to a fast charger. Indicates the type of fast charger. Indicates the brand of fast charger. Indicates the max amperage supported by the charger. The indicator light color of the connector. Indicates if th charge port door is open. Indicates if the charge port latch status. Indicates the charging phase. ```json Example Response { "amperage": 0, "completionTime": null, "wattage": 0, "voltage": 1, "isPluggedIn": false, "state": "NOT_CHARGING", "socLimit": 0.8, "amperageMaxVehicle": 48, "socLimitMax": 1, "socLimitMin": 0.5, "socLimitDefault": 0.8, "amperageRequested": 48, "energyAdded": 11.52, "rangeAddedRated": 70.811, "rangeAddedIdeal": 70.811, "chargeRate": 0, "connector": "", "fastChargerPresent": false, "fastChargerType": "", "fastChargerBrand": "", "amperageMaxCharger": 48, "chargePortColor": "", "chargePortOpen": false, "chargePortLatch": "Engaged", "chargerPhases": null } ``` # Charge Completion Time Source: https://smartcar.com/docs/api-reference/tesla/get-charge-completion-time GET /vehicles/{id}/{make}/charge/completion When the vehicle is charging, returns the date and time when the vehicle is expected to reach its charge limit. When the vehicle is not charging, this endpoint results in a vehicle state error. This endpoint is currently available for `tesla`. ## Permission `read_charge` ## Request `vehicle_id` of the vehicle you are making the request to. The make to pass in the URL. ## Response An ISO8601 formatted datetime (`YYYY-MM-DDTHH:mm:ss.SSSZ`) for the time at which the vehicle expects to complete this charging session. ```json Example Response { "time": "2022-01-13T22:52:55.358Z" } ``` # Charge Billing Records Source: https://smartcar.com/docs/api-reference/tesla/get-charge-records-billing GET /vehicles/{id}/{make}/charge/records/billing Returns information about charging sessions for Tesla vehicles at public Tesla chargers including cost and charging site. ## Permission `read_charge_records` ## Request **Path** **Query** Date of the first record to return in YYYY-MM-DD format. Defaults to 30 days prior or when the owner first granted your application access, whichever is shorter. Date of the final record to return in YYYY-MM-DD format. Defaults to the date of the request. The page number to fetch from Tesla where page 1 contains the most recent records. ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/records/billing?page=12&startDate=2023-08-24" \ -H "Authorization: Bearer {token}" \ -X "GET" \ -H "Content-Type: application/json" \ ``` ```python Python billing = vehicle.request( "GET", "{make}/charge/records/billing?startDate=2023-08-24&page=12" ) ``` ```js Node const billing = vehicle.request( "GET", "{make}/charge/records/billing?startDate=2023-08-24&page=12" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("ford/charge/schedule_by_location") .addQueryParameter("startDate", "2023-08-24") .addQueryParameter("page", "12") .build(); VehicleResponse billing = vehicle.request(request); ``` ```ruby Ruby billing = vehicle.request( "GET", "{make}/charge/records/billing?startDate=2023-08-24&page=12" ) ``` ## Response An array of billing records for the vehicle associated with charging at public Tesla charging stations. Can be empty if the specified page does not contain any records for the vehicle. This **does not** mean that subsequent pages will also contain no records. Please check the `hasMoreData` field for confirmation instead. The date and time of charging session start, formatted in ISO 8601 standard. The date and time of charging session end, formatted in ISO 8601 standard. Energy consumed in the charging session. A cost breakout of the charging session. The currency code for the fees. Fess associated with charging the vehicle. Fees associated with the session other than charging the vehicle e.g. parking. The name of the charging site. Tesla’s id for this charging session. Indicates if there are any more records to fetch from Tesla for this vehicle. **Does not** guarantee a non-empty list for the next page when `true`. ```json Example Response { "records": [ { "chargeEnd": "2022-07-10T16:20:00.000Z", "chargeStart": "2022-07-10T15:40:00.000Z", "energyConsumed": 44.10293884 "cost": { "currency": "USD", "energy": "41", "other": "41" }, "location": "Los Gatos, CA", "recordId": "GF220075000028-3-1682903685" } ], "hasMoreData" : false } ``` # Charge Schedule Source: https://smartcar.com/docs/api-reference/tesla/get-charge-schedule GET /vehicles/{id}/{make}/charge/schedule Returns the charging schedule of a vehicle. The response contains the start time and departure time of the vehicle's charging schedule. ## Permission `read_charge` ## Request **Path** ## Response The departure time configuration for the charging schedule. Indicates whether this schedule type is enabled or disabled. Only one of `departureTime` or `departureTime` can be enabled at a time. When plugged in, the vehicle **may** delay starting a charging session as long as it can reach its [charge limit](/api-reference/evs/get-charge-limit) by this time in HH:mm. The start time configuration for the charging schedule. Indicates whether this schedule type is enabled or disabled. Only one of `departureTime` or `departureTime` can be enabled at a time. When plugged in, the vehicle will delay starting a charging session until this time in HH:mm. ```json Example Response { "departureTime": { "enabled": false, "time": null }, "startTime": { "enabled": true, "time": "18:30" } } ``` # Voltage Source: https://smartcar.com/docs/api-reference/tesla/get-charge-voltmeter GET /vehicles/{id}/{make}/charge/voltmeter When the vehicle is plugged in, returns the charging voltage measured by the vehicle. When the vehicle is not plugged in, this endpoint results in a vehicle state error. This endpoint is currently available for `tesla`. ## Permission `read_charge` ## Request ## Response The potential difference measured by the vehicle in volts (V). ```json Example Response { "voltage": 240 } ``` # Wattage Source: https://smartcar.com/docs/api-reference/tesla/get-charge-wattmeter GET /vehicles/{id}/{make}/charge/wattmeter When the vehicle is charging, returns the instant charging wattage as measured by the vehicle. When the vehicle is not charging, this endpoint results in a vehicle state error. ## Permission `read_charge` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/wattmeter" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python wattmeter = vehicle.request( "GET", "{make}/charge/wattmeter" ) ``` ```js Node const wattmeter = await vehicle.request( "GET", "{make}/charge/wattmeter" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/charge/wattmeter") .build(); VehicleResponse wattmeter = vehicle.request(request); ``` ```ruby Ruby wattmeter = vehicle.request( "GET", "{make}/charge/wattmeter" ) ``` ## Response The instant power measured by the vehicle (in kilowatts). ```json Example Response { "wattage": 3.5 } ``` # Compass Source: https://smartcar.com/docs/api-reference/tesla/get-compass-heading GET /vehicles/{id}/{make}/compass Returns the current compass heading and direction of the vehicle. ## Permission `read_compass` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/compass" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python compass = vehicle.request( "GET", "{make}/compass" ) ``` ```js Node const compass = await vehicle.request( "GET", "{make}/compass" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/compass") .build(); VehicleResponse compass = vehicle.request(request); ``` ```ruby Ruby compass = vehicle.request( "GET", "{make}/compass" ) ``` ## Response The current direction of the vehicle. The current compass heading of the vehicle (in degrees). ```json Example Response { "direction": "SW", "heading": 185 } ``` # Defroster Source: https://smartcar.com/docs/api-reference/tesla/get-defroster GET /vehicles/{is}/{make}/climate/defroster Returns the current state of a vehicle's front and rear defroster. ## Permission `read_climate` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/climate/defroster" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python defroster = vehicle.request( "GET", "{make}/climate/defroster" ) ``` ```js Node const defroster = await vehicle.request( "GET", "{make}/climate/defroster" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/climate/defroster") .build(); VehicleResponse defroster = vehicle.request(request); ``` ```ruby Ruby defroster = vehicle.request( "GET", "{make}/climate/defroster" ) ``` ## Request **Path** ## Response The current state of the front defroster. The current state of the rear defroster. ```json Example Response { "frontStatus": "ON", "rearStatus": "OFF" } ``` # Extended Vehicle Info Source: https://smartcar.com/docs/api-reference/tesla/get-ext-vehicle-info GET /vehicles/{id}/{make}/attributes Returns detailed configuration information for a vehicle. ## Permission `read_extended_vehicle_info` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/attributes" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python attributes = vehicle.request( "GET", "{make}/attributes" ) ``` ```js Node const attributes = await vehicle.request( "GET", "{make}/attributes" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/attributes") .build(); VehicleResponse attributes = vehicle.request(request); ``` ```ruby Ruby attributes = vehicle.request( "GET", "{make}/attributes" ) ``` ## Response A vehicle ID (UUID v4). The manufacturer of the vehicle. The model of the vehicle. The model year. Vehicle's current firmware. Indicates the Tesla's trim. Efficiency package. Performance package. Vehicle's nickname. Driver Assist version. Indicates `true` if the vehicle is currently at the home address set in the vehicle. `False` indicates the vehicle is not at home or home location is not set. This value is `null` if `atHome` status could not be determined. This field comes back as `null` if the vehicle is not capable of supporting Tesla's Telemetry API (streaming). Sentry Mode status and availability. Does the vehicle support Sentry Mode. Is Sentry Mode currently enabled for a vehicle. Descriptors of the vehicle's interior and exterior. Exterior color. Exterior trim. Interior trim. Descriptors of the vehicle's wheel. Style of the wheel. Diameter of the wheel. Details on the vehicle's drive unit(s). Rear drive unit. Front drive unit. ```json Example Response { "driveUnit": { "front": "PM216MOSFET", "rear": "NoneOrSmall" }, "driverAssistVersion": "TeslaAP3", "efficiencyPackage": "MY2021", "firmwareVersion": "2022.8.10.12 0ce482dac45d", "id": "36ab27d0-fd9d-4455-823a-ce30af709ffc", "make": "TESLA", "model": "Model S", "nickname": "Tommy", "performancePackage": "Base", "sentryMode": { "available": false, "enabled": true }, "style": { "exteriorColor": "SolidBlack", "exteriorTrim": "Black", "interiorTrim": "Black2" }, "trimBadging": "74d", "wheel": { "diameter": 482.6, "style": "Apollo" }, "year": 2022, "atHome": true } ``` # Exterior Temperature Source: https://smartcar.com/docs/api-reference/tesla/get-exterior-temperature GET /vehicles/{id}/{make}/thermometer/exterior Returns the vehicle’s last known exterior thermometer reading. See our [climate setting](/docs/api-reference/tesla/get-cabin) endpoints for managing a cabin temperature. ## Permission `read_thermometer` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/thermometer/exterior" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python temperature = vehicle.request( "GET", "{make}/thermometer/exterior" ) ``` ```js Node const temperature = await vehicle.request( "GET", "{make}/thermometer/exterior" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/thermometer/exterior") .build(); VehicleResponse temperature = vehicle.request(request); ``` ```ruby Ruby temperature = vehicle.request( "GET", "{make}/thermometer/exterior" ) ``` ## Response The current exterior temperature of the vehicle. ```json Example Response { "temperature": 33.42 } ``` # Interior Temperature Source: https://smartcar.com/docs/api-reference/tesla/get-interior-temperature GET /vehicles/{id}/{make}/thermometer/interior Returns the vehicle’s last known interior thermometer reading. See our [climate setting](/docs/api-reference/tesla/get-cabin) endpoints for managing a cabin temperature. ## Permission `read_thermometer` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/thermometer/interior" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python temperature = vehicle.request( "GET", "{make}/thermometer/interior" ) ``` ```js Node const temperature = await vehicle.request( "GET", "{make}/thermometer/interior" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/thermometer/interior") .build(); VehicleResponse temperature = vehicle.request(request); ``` ```ruby Ruby temperature = vehicle.request( "GET", "{make}/thermometer/interior" ) ``` ## Response The current interior temperature of the vehicle. ```json Example Response { "temperature": 25.64 } ``` # Migration Status Source: https://smartcar.com/docs/api-reference/tesla/get-migration-status GET /vehicles/{id}/{make}/migration Indicates if the vehicle needs to migrate to Tesla's new API. See [Tesla - What's New](https://smartcar.com/docs/help/oem-integrations/tesla/whats-new) for more details. ## Permission `read_vehicle_info` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/migration" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python status = vehicle.request( "GET", "{make}/migration" ) ``` ```js Node const status = await vehicle.request( "GET", "{make}/migration" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/migration") .build(); VehicleResponse status = vehicle.request(request); ``` ```ruby Ruby status = vehicle.request( "GET", "{make}/migration" ) ``` ## Response Set to `false` if the vehicle is connected to Smartcar via Tesla's new integration. See [Tesla - What's New](/help/oem-integrations/tesla/whats-new) for more details. ```json Example Response { "requiresMigration": false } ``` # Speed Source: https://smartcar.com/docs/api-reference/tesla/get-speedometer GET /vehicles/{id}/{make}/speedometer Returns the current speed of the vehicle. ## Permission `read_speedometer` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/speedometer" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python speed = vehicle.request( "GET", "{make}/speedometer" ) ``` ```js Node const speed = await vehicle.request( "GET", "{make}/speedometer" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/speedometer") .build(); VehicleResponse speed = vehicle.request(request); ``` ```ruby Ruby speed = vehicle.request( "GET", "{make}/speedometer" ) ``` ## Response The current speed of the vehicle. ```json Example Response { "speed": 84.32 } ``` # Steering Heater Source: https://smartcar.com/docs/api-reference/tesla/get-steering-heater GET /vehicles/{id}/{make}/climate/steering_wheel Returns the current state of a vehicle's steering wheel heater system. ## Permission `read_climate` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/climate/steering_wheel" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python steering_wheel = vehicle.request( "GET", "{make}/climate/steering_wheel" ) ``` ```js Node const steeringWheel = await vehicle.request( "GET", "{make}/climate/steering_wheel" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/climate/steering_wheel") .build(); VehicleResponse steeringWheel = vehicle.request(request); ``` ```ruby Ruby steering_wheel = vehicle.request( "GET", "{make}/climate/steering_wheel" ) ``` ## Response The current state of the steering wheel heater system. `UNAVAILABLE` indicates the vehicle is not equipped with a steering wheel heater. ```json Example Response { "status": "ON", } ``` # User Access Source: https://smartcar.com/docs/api-reference/tesla/get-user-access GET /vehicles/{id}/{make}/user/access Returns the account type and permissions for the connected Tesla account. ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/user/access" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python access = vehicle.request( "GET", "{make}/user/access" ) ``` ```js Node const access = await vehicle.request( "GET", "{make}/user/access" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/user/access") .build(); VehicleResponse access =vehicle.request(request); ``` ```ruby Ruby access = vehicle.request( "GET", "{make}/user/access" ) ``` ## Request **Path** ## Response Returns the type of Tesla account connected. Can be either `OWNER` or `DRIVER`. Please see our [Tesla FAQs](/help/oem-integrations/tesla/faqs) for details on the differences between account types. Returns a list of permissions granted by the user with their Tesla account. Please see [this page](/help/oem-integrations/tesla/developers#permission-mappings) on the mapping from Smartcar permissions to Tesla's. ```json Example Response { "accessType": "OWNER", "permissions" : ["vehicle_cmds", "vehicle_device_data"] } ``` ## Notes * If you're receiving a [SERVER:INTERNAL](/errors/api-errors/server-errors#internal) error please have the user reconnect their vehicle. # User Info Source: https://smartcar.com/docs/api-reference/tesla/get-user-info GET /vehicles/{id}/{make}/user/info Returns the email associated with the connected Tesla account. ## Permission `read_user_profile` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/user/info" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python info = vehicle.request( "GET", "{make}/user/info" ) ``` ```js Node const info = await vehicle.request( "GET", "{make}/user/info" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/user/info") .build(); VehicleResponse info =vehicle.request(request); ``` ```ruby Ruby info = vehicle.request( "GET", "{make}/user/info" ) ``` ## Request **Path** ## Response The email associated with the connected Tesla account. ```json Example Response { "email" : "api@smartcar.com" } ``` # Vehicle Status Source: https://smartcar.com/docs/api-reference/tesla/get-vehicle-status GET /vehicles/{id}/{make}/status Returns the status for the vehicle. ## Permission `read_extended_vehicle_info` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/status" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python status = vehicle.request( "GET", "{make}/status" ) ``` ```js Node const status = await vehicle.request( "GET", "{make}/status" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/status") .build(); VehicleResponse status = vehicle.request(request); ``` ```ruby Ruby status = vehicle.request( "GET", "{make}/status" ) ``` ## Response The current status of the vehicle. If the vehicle is asleep, this request will not wake the vehicle. Indicates if the vehicle is in service mode. Indicates the current gear shift position. ```json Example Response { "status": "ASLEEP", "inService": true, "gear": "DRIVE" } ``` # Virtual Key Status Source: https://smartcar.com/docs/api-reference/tesla/get-virtual-key-status GET /vehicles/{id}/{make}/virtual_key Indicates if a vehicle has the appropriate virtual key installed. See [Tesla - What's New](https://smartcar.com/docs/help/oem-integrations/tesla/whats-new#if-your-application-issues-commands) for more details on Tesla's virtual key requirements. ## Permission `read_vehicle_info` ## Request **Path** ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/virtual_key" \ -H "Authorization: Bearer {token}" \ -X "GET" ``` ```python Python virtual_key = vehicle.request( "GET", "{make}/virtual_key" ) ``` ```js Node const virtualKey = await vehicle.request( "GET", "{make}/virtual_key" ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("{make}/virtual_key") .build(); VehicleResponse virtualKey = vehicle.request(request); ``` ```ruby Ruby virtual_key = vehicle.request( "GET", "{make}/virtual_key" ) ``` ## Response Returns `true` if the vehicle has the appropriate Virtual Key installed. See [Tesla - What's New](/help/oem-integrations/tesla/whats-new#if-your-application-issues-commands) for more details on Tesla's virtual key requirements. ```json Example Response { "isPaired": true } ``` ## Notes * This endpoint will throw a [COMPATIBILITY:PLATFORM\_NOT\_CAPABLE](/errors/api-errors/compatibility-errors#platform-not-capable) error if a vehicle is connected to your application via Tesla's legacy integration. * This endpoint will throw a [CONNECTED\_SERVICES\_ACCOUNT:VEHICLE\_MISSING](/errors/api-errors/compatibility-errors#vehicle-missing) error if the Tesla account connected to Smartcar is **not** the Owner of the vehicle. See our [FAQs](/help/oem-integrations/tesla/faqs#can-owner-and-driver-accounts-authorize-access-with-smartcar-through-connect) for more information on Owner and Driver account types. # Cabin Climate Source: https://smartcar.com/docs/api-reference/tesla/set-cabin POST /vehicles/{id}/{make}/climate/cabin Set the temperature and control the cabin climate system for a vehicle. ## Permission `control_climate` ## Request **Path** **Body** Indicate whether to start or stop the cabin climate control system, or set the temperature. If starting or stopping the system, `temperature` is optional and will use the vehicle's current setting by default. Use `SET` to set the `temperature` without changing the climate systems status. Indicate what temperature to set (in Celsius by default or in Fahrenheit using the sc-unit-system). If the provided temperature is out of the bounds allowed by the vehicle's climate control system, the request will fail with the upper and lower limits in the error response message. ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/climate/cabin" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"action": "SET", "temperature": 20}' ``` ```python Python set_climate_cabin = vehicle.request( "POST", "{make}/climate/cabin", { "action": "SET", "temperature": 18 } ) ``` ```js Node const vehicleStopCabin = vehicle.request( "POST", "{make}/climate/cabin", {"action": "STOP"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/climate/cabin") .addBodyParameter("action", "START") .build(); VehicleResponse startClimateCabin = vehicle.request(request); ``` ```ruby Ruby setChargeScheduleByLocation = vehicle.request( "POST", "{make}/climate/cabin", {"action" : "START"} ) ``` ## Response If the request is successful, Smartcar will return `"success"` (HTTP 200 status) containing the current state of the climate cabin system. The target temperature setting of the vehicle when the climate system is on (in Celsius by default or in Fahrenheit using the sc-unit-system). ```json Example Response { "status": "ON", "temperature": 24 } ``` # Amperage Source: https://smartcar.com/docs/api-reference/tesla/set-charge-ammeter POST /vehicles/{id}/{make}/charge/ammeter Set the amperage drawn by the vehicle from the EVSE for the current charging session. If the vehicle is not plugged in, this endpoint results in a vehicle state error. ## Permission `control_charge` ## Request **Path** **Body** The target amperage to be drawn by the vehicle from the charging point (in amperes). If the value passed is greater than what is supported by the charger, it will be set to the maximum. ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/ammeter" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"amperage": 48}' ``` ```python Python ammeter = vehicle.request( "POST", "{make}/charge/ammeter", {"amperage": 48} ) ``` ```js Node const ammeter = vehicle.request( "POST", "{make}/charge/ammeter", {"amperage": 48} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/charge/ammeter") .addBodyParameter("amperage": 48) .build(); VehicleResponse ammeter = vehicle.request(request); ``` ```ruby Ruby ammeter = vehicle.request( "POST", "{make}/charge/ammeter", {"amperage": 48} ) ``` ## Response If the request is successful, Smartcar will return “success” (HTTP 200 status). If the amperage passed was greater than what is supported by the charger, it will be set to the maximum which will be shown here. If the request is successful, Smartcar will return a message (HTTP 200 status) containing the amperage set to be drawn from the vehicle. ```json Example Response { "message": "Successfully sent the following amperage: 48", "status": "success" } ``` # Charge Schedule Source: https://smartcar.com/docs/api-reference/tesla/set-charge-schedule POST /vehicles/{id}/{make}/charge/schedule Sets the charging schedule for a vehicle. ## Permission `control_charge` ## Request **Path** **Body** The type of schedule you want to set. When plugged in, the vehicle will delay starting a charging session until this time in `HH:mm`. When plugged in, the vehicle may delay starting a charging session as long as it can reach its [charge limit](/api-reference/evs/get-charge-limit) by this time in `HH:mm`. Enables or disables the specified charging schedule. The time for the provided schedule type in HH:mm. ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/schedule" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"type": "START_TIME", "enable": true, "time": "23:30"}' ``` ```python Python chargeSchedule = vehicle.request( "POST", "{make}/charge/schedule", {"type": "START_TIME", "enable": true, "time": "23:30"} ) ``` ```js Node const chargeSchedule = vehicle.request( "POST", "{make}/charge/schedule", {"type": "START_TIME", "enable": true, "time": "23:30"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/charge/schedule") .addBodyParameter("type", "START_TIME") .addBodyParameter("enable", "true") .addBodyParameter("time", "23:30") .build(); ChargeSchedule chargeSchedule = vehicle.request(request); ``` ```ruby Ruby chargeSchedule = vehicle.request( "POST", "{make}/charge/schedule", {"type": "START_TIME", "enable": true, "time": "23:30"} ) ``` ## Response The departure time configuration for the charging schedule. Indicates whether this schedule type is enabled or disabled. Only one of `departureTime` or `departureTime` can be enabled at a time. When plugged in, the vehicle **may** delay starting a charging session as long as it can reach its [charge limit](/api-reference/evs/get-charge-limit) by this time in HH:mm. The start time configuration for the charging schedule. Indicates whether this schedule type is enabled or disabled. Only one of `departureTime` or `departureTime` can be enabled at a time. When plugged in, the vehicle will delay starting a charging session until this time in HH:mm. ```json Example Response { "departureTime": { "enabled": false, "time": null }, "startTime": { "enabled": true, "time": "18:30" } } ``` # Defroster Source: https://smartcar.com/docs/api-reference/tesla/set-defroster POST /vehicles/{id}/{make}/climate/defroster Start or stop the front and rear defroster for a vehicle. ## Permission `control_climate` ## Request **Path** **Body** Indicate whether to start or stop defrosting the vehicle. Options: `START` or `STOP` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/climate/defroster" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"action" : "STOP"}' ``` ```python Python defroster = vehicle.request( "POST", "{make}/climate/defroster", {"action" : "STOP"} ) ``` ```js Node const defroster = vehicle.request( "POST", "{make}/climate/defroster", {"action" : "STOP"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/climate/defroster") .addBodyParameter("action" : "STOP") .build(); VehicleResponse defroster = vehicle.request(request); ``` ```ruby Ruby defroster = vehicle.request( "POST", "{make}/climate/defroster", {"action" : "STOP"} ) ``` ## Response If the request is successful, Smartcar will return `status` containing the action sent to the climate defroster system of the vehicle. ```json Example Response { "status": "START" } ``` # Set PIN to Drive Source: https://smartcar.com/docs/api-reference/tesla/set-pin-to-drive POST /vehicles/{id}/{make}/pin Enables this feature on the vehicle and sets the PIN needed in order to drive it. ## Permission `control_pin` ## Request **Path** **Body** A four digit numeric PIN ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/pin" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"pin" : "1234"}' ``` ```python Python pin = vehicle.request( "POST", "{make}/pin", {"pin" : "1234"} ) ``` ```js Node const pin = vehicle.request( "POST", "{make}/pin", {"pin" : "1234"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/pin") .addBodyParameter("pin" : "1234") .build(); VehicleResponse pin = vehicle.request(request); ``` ```ruby Ruby pin = vehicle.request( "POST", "{make}/pin", {"pin" : "1234"} ) ``` ## Response If the request is successful, Smartcar will return “success”. If the request is successful, Smartcar will return a message. ```json Example Response { "message": "Successfully sent request to vehicle", "status": "success" } ``` ## Notes * Calling this endpoint will override an existing PIN on the vehicle. * Call `DELETE` [PIN to Drive](/api-reference/tesla/clear-pin-to-drive) in order to enable this feature and set the PIN * Currently both owner and driver account types can set a PIN for the vehicle and enable the feature via the API. * Only account owners can disable this feature from the Tesla app. # Steering Heater Source: https://smartcar.com/docs/api-reference/tesla/set-steering-heater POST /vehicles/{id}/{make}/climate/steering_wheel Start or stop heating a vehicle's steering wheel. ## Permission `control_climate` ## Request **Path** **Body** Indicate whether to start or stop heating the vehicle's steering wheel. Options: `START` or `STOP` ```curl cURL curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/climate/steering_wheel" \ -H "Authorization: Bearer {token}" \ -X "POST" \ -H "Content-Type: application/json" \ -d '{"action" : "STOP"}' ``` ```python Python steering_wheel = vehicle.request( "POST", "{make}/climate/steering_wheel", {"action" : "STOP"} ) ``` ```js Node const steeringWheel = vehicle.request( "POST", "{make}/climate/steering_wheel", {"action" : "STOP"} ); ``` ```java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("POST") .path("{make}/climate/steering_wheel") .addBodyParameter("action" : "STOP") .build(); VehicleResponse steeringWheel = vehicle.request(request); ``` ```ruby Ruby steering_wheel = vehicle.request( "POST", "{make}/climate/steering_wheel", {"action" : "STOP"} ) ``` ## Response If the request is successful, Smartcar will return status containing the action sent to the vehicle. `UNAVAILABLE` indicates the vehicle is not equipped with a steering wheel heater. ```json Example Response { "status": "START", } ``` # User Source: https://smartcar.com/docs/api-reference/user GET /user Returns the ID of the vehicle owner who granted access to your application. This should be used as the static unique identifier for storing the access token and refresh token pair in your database. Note: A single user can own multiple vehicles, and multiple users can own the same vehicle. When using Single Select for Connect, a single user with multiple vehicles will have a 1:1 (`access_token`:`vehicle_id`) mapping. ## Response A user ID (UUID v4). ```json Example Response { "id": "e0514ef4-5226-11e8-8c13-8f6e8f02e27e" } ``` # Callback URI Verification Source: https://smartcar.com/docs/api-reference/webhooks/callback-verification Verify your newly-created webhook. This page covers the verification step **when first setting up a webhook** on Dashboard. Please see our [payload verification](/api-reference/webhooks/payload-verification) section for information on how to verify webhook payloads from vehicles. When you first set up a webhook in the Smartcar Dashboard, Smartcar will post a challenge request to ensure we're sending payloads to the correct place. This is a **one time** event and will be in the following format: ```json verificationRequest.body { "version": "2.0", "webhookId": "", "eventName": "verify", "payload": { "challenge": "" } } ``` Upon receiving the request, your server will need respond to the challenge by hashing `payload.challenge` with your `application_management_token` to create a `SHA-256` based `HMAC`. Our [backend SDKs](/api-reference/api-sdks) have helper methods to generate the `HMAC`. ```python Python hmac = smartcar.hash_challenge( application_management_token, payload.challenge ) ``` ```js Node let hmac = smartcar.hashChallenge( application_management_token, payload.challenge ); ``` ```java Java String hmac = Smartcar.hashChallenge( application_management_token, payload.challenge ); ``` ```ruby Ruby hmac = Smartcar.hash_challenge( application_management_token, payload.challenge ) ``` Return the hex-encoded hash as the value for `challenge` in your response body with a `200` status code, and the `Content-Type` header set to `application/json`. ```json verificationResponse.body { "challenge" : "{HMAC}" } ``` # Payload Verification Source: https://smartcar.com/docs/api-reference/webhooks/payload-verification This page covers verification of payloads from vehicles. Please see our [callback verification](/api-reference/webhooks/callback-verification) section for information on how to initially verify your callback uri. Verify webhook payloads against the `SC-Signature` header and a `SHA-256` based `HMAC` generated by hashing your `application_management_token` and the body. Our [backend SDKs](/api-reference/api-sdks) have helper methods that return `true` if the payload is good. ```python Python Smartcar.verify_payload( {application_management_token}, {SC-Signature}, {webhook_body} ) ``` ```js Node smartcar.verify_payload( {application_management_token}, {SC-Signature}, {webhook_body} ); ``` ```java Java Smartcar.verifyPayload( {application_management_token}, {SC-Signature}, {webhook_body} ); ``` ```ruby Ruby Smartcar.verify_payload( {application_management_token}, {SC-Signature}, {webhook_body} ) ``` # Subscribe Source: https://smartcar.com/docs/api-reference/webhooks/subscribe-webhook POST /vehicles/{id}/webhooks/{webhook_id} Subscribe a vehicle to a webhook. ## Request **Path** The webhook id you are subscribing the vehicle to. This can be found in Dashboard under Webhooks. ## Response The [vehicle id](/api-reference/all-vehicles) of the vehicle you are making a request to. The webhook id you are subscribing the vehicle to. ```json ResponseExample { "vehicleId": "dc6ea99e-57d1-4e41-b129-27e7eb58713e", "webhookId": "9b6ae692-60cc-4b3e-89d8-71e7549cf805" } ``` # Unsubscribe Source: https://smartcar.com/docs/api-reference/webhooks/unsubscribe-webhook DELETE /vehicles/{id}/webhooks/{webhook_id} Unsubscribe a vehicle from a webhook. ## Request **Header** In the format `Bearer {application_management_token}`. You can find your `application_management_token` under your Application Configuration in Dashboard. **Path** The [webhook id](api-reference/management/all-vehicles) you are unsubscribing the vehicle from. ## Response Status of the request. ```json Example Response { "status": "success" } ``` # 2022 Releases Source: https://smartcar.com/docs/changelog/2022 ## January 5, 2022 Smartcar is now compatible with Mercedes-Benz vehicles in the United States. ## February 23, 2022 The EV Battery and EV Charging status and control endpoints are now available for Lexus and Toyota vehicles in Canada and the United States. ## February 21, 2022 The Tire Pressure endpoint is now available for Lexus and Toyota vehicles in Canada and the United States. ## February 14, 2022 Smartcar is now compatible with Chrysler, Dodge, Jeep, and RAM vehicles in Canada. ## February 2, 2022 Brand-specific endpoints are now available for Cadillac, Chevrolet, and Tesla. A full list of the available endpoints is available in the API Reference. ```Node Node const amperage = vehicle.request('GET', 'tesla/charge/ammeter'); ``` ```Python Python amperage = vehicle.request("GET", "tesla/charge/ammeter") ``` ```Java Java SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder() .method("GET") .path("tesla/charge/ammeter") .build(); VehicleResponse amperage = vehicle.request(request); ``` ```Ruby Ruby amperage = vehicle.request("GET", "tesla/charge/ammeter") ``` ## March 7, 2022 Smartcar is now compatible with MINI vehicles in Canada, the United States, and our supported European countries. ## April 13, 2022 Smartcar's webhooks now have beta support for sending events in response to events that are generated by the vehicle itself. The initial release supports the following events on Ford, Tesla, and Toyota vehicles in Canada, the United States, and our supported European countries: * `CHARGING_STARTED` * `CHARGING_STOPPED` * `CHARGING_COMPLETED` Webhook events sent in response to vehicle events can be distinguished from schedule events based on the `eventName` property of the POST body. For example, the POST body for event based webhooks will have the following structure: ```json { "version": "2.0", "webhookId": "uuid", "eventName": "eventBased", "mode": "test|live", "payload": { "eventId": "uuid", "vehicleId": "uuid", "eventType": "CHARGING_STARTED|CHARGING_STOPPED|CHARGING_COMPLETED", "eventTime": "ISO8601 Datetime" } } ``` ## May 9, 2022 Smartcar is now compatible with Kia vehicles in our supported European countries. ## May 5, 2022 The API now returns more detailed errors for the following: `UPSTREAM:RATE_LIMIT` - a request fails due to a vehicle rate limit. `VEHICLE_STATE:NOT_CHARGING` - a vehicle is not charging (only applies to endpoints that return details about a specific charging session e.g. Charging Completion Time). ## June 29, 2022 Smartcar is now compatible with Peugeot and Opel vehicles in our supported European countries. ## June 22, 2022 The Tire Pressure endpoint is now available for BMW, MINI, and Tesla vehicles in Canada, the United States, and our supported European countries. ## June 15, 2022 The API now returns a more detailed VEHICLE\_STATE error whenever a charge request fails due to charger issues or charging schedules. Click the following link to learn more: VEHICLE\_STATE:CHARGE\_FAULT ## June 8, 2022 Smartcar is now compatible with Nissan vehicles in our supported European countries. ## July 20, 2022 Smartcar is now compatible with Citroën, DS, and Vauxhall vehicles in our supported European countries. ## July 6, 2022 The following brand-specific endpoints are now available for Tesla vehicles in Canada, the United States, and our supported European countries: * GET `/tesla/compass` * GET `/tesla/speedometer` ## August 24, 2022 Smartcar is now compatible with Rivian vehicles in the United States. ## August 3, 2022 Smartcar is now compatible with Škoda vehicles in our supported European countries. The EV Charging control endpoint is now available for Hyundai vehicles in the United States. The EV Battery Capacity endpoint is now available in our supported European countries. ## September 22, 2022 The following brand-specific endpoint is now available for Tesla vehicles in Canada, the United States, and our supported European countries: * POST /tesla/charge/ammeter ## November 30, 2022 Smartcar is now compatible with Kia vehicles in Canada and the United States. ## December 29, 2022 The Location endpoint is now available for Volkswagen ID series vehicles in our supported European countries. # 2023 Releases Source: https://smartcar.com/docs/changelog/2023 ## January 6, 2023 Smartcar API v1.0 has been sunset and is no longer supported. If you are currently using v1.0 for API requests, webhooks, errors, or compatibility, we recommend switching to v2.0 as soon as possible. ## March 16, 2023 The API now returns a new code for the RATE\_LIMIT error type if your application tries to make a request to a vehicle too frequently. Click the following link to learn more: [RATE\_LIMIT:VEHICLE](https://smartcar.com/docs/errors/v2.0/rate-limit/#vehicle) ## March 14, 2023 Smartcar has revamped the Connect flow UI and backend to improve error handling and optimize user conversion rates. Our updates fall into 3 categories: improving brand selection, expanding login methods, and establishing new error codes specific to Connect. These include: 1. Allowing a user to search for: a. Brand aliases in Brand Select such as VW for Volkswagen b. Unavailable brands that we plan to introduce in the future, which will display a message highlighting future compatibility with the chosen brand. 2. Expanding login method coverage to include phone numbers for certain brands. We now allow users to log in using email or phone number for the Connect flow starting with Kia and Mercedes-Benz. Stay tuned to our changelog for more brand updates. 3. Providing clearer errors for the Connect flow: a. no\_vehicles for when the user does not have any vehicles tied to their account and they click to go back to the application b. configuration\_error for when exiting Connect back to your app through an error page (see below). c. server\_error which is thrown if there is not another Connect error specified. More documentation on error handling can be found [here](https://smartcar.com/docs/integration-guide/test-your-integration/test-errors/#1-connect-errors). ## March 6, 2023 The disconnect endpoint now supports the use of management API token (MAT) for authorization purposes. Documentation can be found [here](https://smartcar.com/docs/api#delete-disconnect) ## May 10, 2023 Smartcar is now compatible with Infiniti vehicles in the United States. ## June 7, 2023 Smartcar is now compatible with Hyundai vehicles in Canada. ## June 5, 2023 Test mode supports the following email format with any password to generate an account with multiple vehicles: `-vehicles@smartcar.com` ## July 26, 2023 The following brand-specific endpoints are now available for Tesla vehicles in Canada, the United States, and our supported European countries: * GET `/tesla/charge/records` * GET `/tesla/charge/records/billing` ## July 19, 2023 Smartcar is now compatible with Mercedes-Benz vehicles in our supported European countries. ## July 12, 2023 The following brand-specific endpoints are now available for Tesla vehicles in Canada, the United States, and our supported European countries: * GET `/tesla/charge/schedule` * POST ` /tesla/charge/schedule` * GET `/tesla/climate/cabin` * POST ` /tesla/climate/cabin` * GET `/tesla/climate/defroster` * POST ` /tesla/climate/defroster` * GET `/tesla/climate/steering_wheel` * POST ` /tesla/climate/steering_wheel` ## August 22, 2023 The following brand-specific endpoints are now available for Nissan vehicles in the United States: * GET /nissan/charge/schedule * PUT /nissan/charge/schedule ## August 17, 2023 The following endpoints are now available to manage vehicle connections: * GET Vehicle Connections * DELETE Vehicle Connections ## August 9, 2023 The following brand-specific endpoints are now available for Ford and Lincoln vehicles in Canada, the United States, and our supported European countries: * GET ford/charge/schedule\_by\_location * PUT ford/charge/schedule\_by\_location * GET lincoln/charge/schedule\_by\_location * PUT lincoln/charge/schedule\_by\_location ## September 21, 2023 Introducing Vehicle Management! With this initial release you're able to see and manage vehicles connected to your applications from within the [Smartcar Dashboard](https://dashboard.smartcar.com/login).

Logos and brand names are for identification purposes only and do not indicate endorsement of or affiliation with Smartcar. ## September 19, 2023 [Charge Records](/api-reference/bmw/get-charge-records) is now available as a make specific endpoint for BMW and MINI in Canada, the United States, and our supported European countries. ## September 06, 2023 Lock Status is now available as a Core endpoint and supported by the following makes: * Tesla (Global) * Ford (Global) * Kia (Global) * Jaguar (Global) * Land Rover (Global) * BMW (Global) * MINI (Global) * Lincoln (US) * Toyota (US) * Lexus (US) In addition to the lock status of the vehicle, Smartcar will also return the open status of doors, sunroof, windows, based on what the vehicle supports. ## October 19, 2023 BMW and MINI EVs are now compatible with the following endpoints globally: * [Get Charge Limit](/api-reference/evs/get-charge-limit) * [Set Charge Limit](/api-reference/evs/set-charge-limit) ## October 5, 2023 Smartcar is now compatible with Hyundai in supported European countries. ## October 3, 2023 Smartcar is now compatible with Mazda and Porsche in supported European countries. ## November 15, 2023 Smartcar is now compatible with CUPRA in supported European countries. # 2024 Releases Source: https://smartcar.com/docs/changelog/2024 ## Fetched At Header A new [SC-Feched-At](https://smartcar.com/docs/api-reference/headers) header is now available. This new header highlights when Smartcar fetched the returned data from an OEM whereas `sc-data-age` indicates when the returned data was recorded by the vehicle. ## Connect Playground The [Connect Playground](https://smartcar.com/docs/getting-started/dashboard/playground) is available, making it easier than ever to create your Connect URL and start requesting vehicle consent. ## Diagnostic Webhook A new [Diagnostic Webhook](https://smartcar.com/docs/getting-started/tutorials/webhooks-diagnostic) is available in beta. This webhook delivers either [Diagnostic Trouble Code](https://smartcar.com/docs/api-reference/get-dtcs) events or [System Status](https://smartcar.com/docs/api-reference/get-system-status) changes. ## Diagnostic Trouble Codes A new [Diagnostic Trouble Code](https://smartcar.com/docs/api-reference/get-dtcs) endpoint is available in beta. This endpoint returns a list of active Diagnostic Trouble Codes (DTCs) and the timestamp they last became active. ## Ford authentication update Ford's authentication process has been updated to require the use of SDKs. Our [Connect SDKs](https://smartcar.com/docs/connect/connect-sdks) have been updated to redirect to Ford's site to handle the authentication process when the user logs in. ## System Status endpoint now in Beta A new [System Status](https://smartcar.com/docs/api-reference/get-system-status) endpoint is available in beta. This endpoint returns a list of vehicle components and their health state for FCA and GM makes. ## Webhooks subscription status The Smartcar Dashboard now indicates which webhooks a vehicle is subscribed to. From the Vehicles table, click into the three dot menu to view vehicle details. From here, navigate to the new Webhooks tab! ## Dynamic Webhooks now in Beta [Dynamic Webhooks](/getting-started/tutorials/webhooks-dynamic) are now in beta for Enterprise customers! Please request access from the Webhooks tab on the Smartcar Dashboard! ## Multi-Factor Authentication in Dashboard [Multi-Factor Authentication](/getting-started/dashboard-mfa) is available to offer an additional layer of security for the Smartcar Dashboard. ## Support for MG in Europe Support for the following endpoints are now available for the MG brand in Europe: * [VIN](/api-reference/get-vin) * [Odometer](/api-reference/get-odometer) * [Lock Status](/api-reference/get-lock-status) * [Lock/Unlock](/api-reference/control-lock-unlock) * [Tire Pressure](/api-reference/get-tire-pressure) * [GET Charge Limit](/api-reference/get-charge-limit) * [POST Charge Limit](/api-reference/set-charge-limit) * [Battery Level](/api-reference/get-battery-level) * [Battery Capacity](/api-reference/get-battery-capacity) ## Support for Honda, Subaru, Acura, and more! Smartcar is now compatible with the **Honda Prologue**, **Subaru Solterra** and the **Acura ZDX** in supported regions. ### Additional Releases The following brands now support [Control Charge](/api-reference/control-charge), [Battery Level](/api-reference/get-battery-level), [Battery Capacity](/api-reference/evs/get-battery-capacity) and [Charge Status](/api-reference/get-charge-status): * Jeep, Fiat and Alfa Romeo (US, Canada and Europe) * Chevrolet, Cadillac and GMC (US and Canada) * RAM and Dodge (US and Canada) * Porsche (US and Europe) * Mazda (US and Europe) * Renault (Europe) * Nissan (Europe) ## Smartcar is now compatible with Dacia in Europe. Support for the following endpoints are now available for the MG brand in Europe: * [Vehicle Info](/api-reference/get-vehicle-info) * [Location](/api-reference/get-location) * [Control Charge](/api-reference/control-charge) * [State of Charge](/api-reference/get-battery-level) * [Charging Status](/api-reference/get-charge-status) ## Connect Insights is now available! * Each Connect flow launched for the previous two weeks is available in the Smartcar Dashboard with a variety of ways to search for specific Connect launches. * Enterprise customers have access to funnel analysis so they can understand their conversion rates in the Connect flow. ## Test & Simulated modes are now one Test and Simulated mode have been combined into a singular mode; Simulated. If a simulated vehicle is enabled, we will return data following the selected trip. If the simulated vehicle doesn't support the requested endpoint, randomized data will be returned. If no simulated vehicle is enabled for, we will return data as if a simulated vehicle with "Day Commute" was selected. If the simuday commute doesn't support the requested endpoint, randomized data will be returned. ## Support for Google authentication in Dashboard The Smartcar Dashboard now supports Google authentication. ## User information for Tesla The following endpoints are now available for Tesla: * [Get User Info](/api-reference/tesla/get-user-info) * [Get User access](/api-reference/tesla/get-user-access) ## Customize brands in Connect You can now customize which bands show up in Connect from the [Dashboard](https://dashboard.smartcar.com/). Easily manage which brands your users can connect to based on engine type or endpoint. ## Get charge endpoint for Audi The following Brand Specific Endpoint is now available for Audi: * [Get Charge Status](/api-reference/audi/get-charge) ## Additional endpoints for Audi The following endpoints are now available for Audi: * [Get Charge Limit](/api-reference/evs/get-charge-limit) * [Set Charge Limit](/api-reference/evs/set-charge-limit) * [Control Charge](/api-reference/evs/control-charge) * [Lock Status](/api-reference/get-lock-status) ## Service history The following endpoint is now available for Ford, Lincoln, Toyota, Lexus, Mazda and Volkswagen (US) vehicles: * [GET /service/history](/api-reference/get-service-records) ## Tesla alerts The following make specific endpoint is now available for Tesla across all supported regions: * [GET /tesla/alerts](/api-reference/tesla/get-alerts) ## Tesla charge battery and suggested user messages The following make specific endpoints are now available for Tesla across all supported regions: * [GET /tesla/charge](/api-reference/tesla/get-charge) * [GET /tesla/battery](/api-reference/tesla/get-battery) ### Additional Releases Suggested user messages are now included as part of API error responses for you to easily surface resolution steps to vehicle owners. See our [error documentation](/errors/overview) for more details. ## Country management for Smartcar Connect Country Management is now available for Connect! Easily manage what countries are enabled for your application on Dashboard. ### Additional Releases The `user` parameter is now available when [building the Connect URL](/connect/redirect-to-connect) to pass a unique identifier for a vehicle owner to track and aggregate analytics across their Connect sessions for your application. ## Organization access for teams Organization access for Teams is now available on Dashboard. Check out our docs page on [Teams](/help/teams) for details. ### Additional Releases The following endpoint is now available for Tesla vehicles globally: * [Virtual Key Status](/api-reference/tesla/get-virtual-key-status) ## Subaru US Smartcar is now compatible with Subaru in the US. ### Additional Releases The following endpoints are now available for Tesla vehicles globally: * [Control Charge Port](/api-reference/tesla/control-charge-port) * [Control Frunk](/api-reference/tesla/control-frunk) * [Control Trunk](/api-reference/tesla/control-trunk) ## Fuel endpoint for European brands The [GET /fuel](/api-reference/get-fuel-tank) endpoint is now available for the following brands in supported European countries: |
|
|
|
| | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | | Audi | Hyundai | Mercedes-Benz | Skoda | | BMW | Jaguar | MINI | Vauxhall | | Citroen | Kia | Opel | Volkswagen | | DS | Land Rover | Peugeot | Volvo | | Ford | Mazda | Renault | | # Latest Releases Source: https://smartcar.com/docs/changelog/latest Learn about Smartcar's latest product updates and improvements