Update Emission For A Vehicle

Request

PATCH https://backend.net0.com/v1/vehicles/{vehicleId}/emissions/{emissionsId}

This endpoint allows for the partial update of an existing vehicle emission available on your Net0 account.

curl --location --request PATCH 'https://backend.net0.com/v1/vehicles/948bde0e-e8b9-4e9e-af74-d605b48d1f57/emissions/d468771a-867e-4e3b-8be0-66b05ab914e1' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 5,
    "startDateUtc": "2021-11-28T02:03:30.512Z",
    "endDateUtc": "2021-11-29T02:03:30.512Z"
}'

Field Parameters

AttributeTypeDescriptionInRequired
vehicleIdStringThe id of the vehicle.pathtrue
emissionIdStringThe id of the emission to update.pathtrue
bodyPatchOperationsThe update operations to be carried out on existing emisionbodytrue
startDateUtcStringThe startDateUtc is required for the update operation to be carried out.bodytrue
endDateUtcStringThe endDateUtc is required for the update operation to be carried out,bodytrue

Response

The response returns the updated emission.

{
    "startDate": "2021-11-28T02:03:30.512Z",
    "endDate": "2021-11-29T02:03:30.512Z",
    "amount": 2,
    "comment": "Vehicle has emssions",
    "totalEmission": 3.88,
    "emissionId": "d468771a-867e-4e3b-8be0-66b05ab914e1",
    "emission": {
        "ch4": 0.004281151495020996,
        "co2": 3.8626600001319806,
        "n2o": 0.010619235430886761,
        "co2e": 3.88,
        "unitId": 2,
        "companyId": 2,
        "id": "d468771a-867e-4e3b-8be0-66b05ab914e1",
        "createdAt": "2021-11-27T16:03:26.074Z",
        "updatedAt": "2021-11-27T16:03:26.074Z"
    },
    "vehicleId": "948bde0e-e8b9-4e9e-af74-d605b48d1f57",
    "companyId": 2,
    "id": "dfb35c1d-79d4-4b14-809f-e0013a6972aa",
    "createdAt": "2021-11-27T16:03:26.082Z",
    "updatedAt": "2021-11-27T16:03:26.082Z"
}