Update the vehicles of a vehicle group

Adds and removes several saved vehicles in one vehicle group of the application's organization, with a result for each vehicle, so one bad id does not fail the whole request.

Input. groupId in the path. The body holds add and remove, arrays of numeric vehicle ids, each optional, at most 500 ids per array and no id twice. At least one id is required, and an id may not be in both arrays.

Response. 200 with { groupId, memberCount, results }: one entry per id, the additions first and then the removals, each in the order sent. status is added or removed when the call changed the group, unchanged when the vehicle was already in that state, notFound when the vehicle does not exist or is not visible to the access token, unsaved when it is an unsaved vehicle, and conflict (with a message) when a private vehicle cannot join a group that is not private. memberCount counts the vehicles of the group after the change that the access token may see.

Notes. A missing group is a 404 for the whole request. A rule about the group as a whole refuses the whole request with 409 before anything changes: removing the last vehicles of a group an alert uses, or adding vehicles hidden from users of an alert that uses the group.

Side effects. The updated group is sent to the Cores that use it, once for the additions and once for the removals.

Request examples

POST /v3/vehicle-api/groups/6512bd43d9caa6e02c990b0a/vehicles/batch

{ "add": [1093527491036451] }

POST /v3/vehicle-api/groups/6512bd43d9caa6e02c990b0a/vehicles/batch

{ "add": [1093527491036451, 1093527491036452], "remove": [1093527491036453] }

Required scope: write:vehicles

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The 24-character id of the vehicle group, from List vehicle groups.

Body Params

The vehicle ids to add to and remove from the group.

add
array of integers, unique
length ≤ 500

Vehicle ids to add to the group, at most 500.

add
remove
array of integers, unique
length ≤ 500

Vehicle ids to remove from the group, at most 500.

remove
Responses

400

groupId is not a 24-character id, a list holds more than 500 ids, a duplicate or an id that is not a positive integer, both lists are empty, or an id is in both.

404

Vehicle group not found in this organization.

409

The change would leave empty a group that an alert uses, or would add vehicles hidden from users of an alert that uses the group. Nothing was changed.

429

Too many requests. Try again later.

500

Internal server error.

Language
Credentials
OAuth2
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*