Vehicle State

When a vehicle is first subscribed to a webhook, Smartcar will send an initial payload that attempts to get all the signals you’re subscribed to for that vehicle with a VEHICLE_STATE type. Subsequent events will contain a payload with the same event type but only the relevant signals based on your webhook configuration. (i.e, when a signal changes, on a schedule, etc.)
{
    "eventId": "1234567890",
    "eventType": "VEHICLE_STATE",
    "data": {
        "vehicle": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "make": "Test Make",
            "model": "Test Model",
            "year": 2020,
            "vin": "1HGCM82633A123456"
        },
        "signals": [
            {
                "code": "location-preciselocation",
                "name": "PreciseLocation",
                "group": "Location",
                "body": {
                    "latitude": 37.7749,
                    "longitude": -122.4194,
                    "heading": 90,
                    "direction": "N",
                    "locationType": "CURRENT"
                }
            },
            {
                "code": "tractionbattery-stateofcharge",
                "name": "StateOfCharge",
                "group": "TractionBattery",
                "body": {
                    "percentage": 75
                }
            }
        ],
        "user": {
            "id": "user_1234567890"
        }
    },
    "triggers": [
        {
            "type": "SIGNAL_UPDATED",
            "signal": {
                "code": "tractionbattery-stateofcharge"
            }
        }
    ],
    "meta": {
        "version": "3.0",
        "deliveryId": "1234567890",
        "deliveredAt": 1700000000,
        "webhookId": "123e4567-e89b-12d3-a456-426614174000",
        "webhookName": "Charge Places Webhook",
        "signalCount": 5,
        "mode": "LIVE"
    }
}

Vehicle connection or compatibility issues

There may be times when Smartcar is unable to get vehicle data because there is an issue with our connection to the vehicle that requires vehicle owner interaction, or because the subscribed vehicle does not support some of the signals you have configured. Smartcar will allow you to subscribe any vehicle to your webhook. When processing the initial payload, we will report compatibility issues to your error callback URI. For example, if a vehicle is not capable of the nickname signal we would send data for other signals as normal, but send the following payload for the nickname signal instead. When either of these happens, we’ll send a VEHICLE_ERROR payload to your vehicle error callback URI. If you don’t specify a callback URI for errors, Smartcar will send them to the same vehicle data callback URI. For a list of possible errors, please refer to the API Errors section.
{
    "eventId": "1234567890",
    "eventType": "VEHICLE_ERROR",
    "errors": [
        {
            "type": "COMPATIBILITY",
            "code": "VEHICLE_NOT_CAPABLE",
            "description": "The vehicle is not capable of surfacing these signals.",
            "docURL": "https://smartcar.com/docs/errors/api-errors/vehicle-state-errors#remote-access-disabled",
            "resolution": {
                "type": "CONTACT_SUPPORT"
            },
            "signals": [
                {
                    "code": "nickname"
                }
            ]
        }
    ],
    "meta": {
        "version": "4.0",
        "deliveryId": "1234567890",
        "deliveredAt": 1700000000,
        "webhookId": "123e4567-e89b-12d3-a456-426614174000",
        "webhookName": "Your Webhook Name",
        "deliveryTime": 1756237151168,
        "signalCount": 5,
        "mode": "LIVE"
    }
}

```json
{
    "eventId": "1234567890",
    "eventType": "VEHICLE_ERROR",
    "errors": [
        {
            "type": "COMPATIBILITY",
            "code": "VEHICLE_NOT_CAPABLE",
            "description": "The vehicle is not capable of surfacing these signals.",
            "docURL": "https://smartcar.com/docs/errors/api-errors/vehicle-state-errors#remote-access-disabled",
            "resolution": {
                "type": "CONTACT_SUPPORT"
            },
            "signals": [
                {
                    "code": "location-preciselocation"
                },
                {
                    "code": "tractionbattery-stateofcharge"
                }
            ]
        }
    ],
    "meta": {
        "version": "4.0",
        "deliveryId": "1234567890",
        "deliveredAt": 1700000000,
        "webhookId": "123e4567-e89b-12d3-a456-426614174000",
        "webhookName": "Bad Webhook",
        "signalCount": 5,
        "mode": "LIVE"
    }
}
While a vehicle is in one of these states, you may be unable to receive data from the vehicle until the owner has taken the necessary steps to re-establish the connection. Upon resolution of the issue, Smartcar will send another payload to your error callback URI with state set to RESOLVED. If you don’t specify a callback URI for errors, Smartcar will send them to the same vehicle data callback URI.
Fixing one issue may surface another one. In these cases, Smartcar will send another payload indicating what the new issue is.