Skip to main content

Update Driver Tag Assignment

PUT 

/drivers/tags/assignments/:assignment_id

This endpoint changes an assignment. Only the fields present in the body are changed. Send unassigned_ts: null to remove the end, and omit it to keep the current end. The overlap rule of POST /drivers/tags/assignments applies whenever assigned_ts or unassigned_ts is sent.

A changed assigned_ts or unassigned_ts earlier than midnight of the day 5 years ago is refused with 422 under the field that was sent. A date sent back exactly as it is stored is accepted, so an assignment older than 5 years can still be edited. For example {"error": {"code": 422, "message": "The given data was invalid.", "data": {"unassigned_ts": ["The unassigned_ts must be a date after or equal to 2021-10-27 00:00:00."]}}}.

lost: true marks the tag lost and ends the assignment now. lost: false recovers it. The assignment stays as history with its end unchanged, and the tag can be assigned again. Only a running assignment can be marked lost. A lost assignment accepts only lost: false.

A subuser needs edit permission on the current driver, and on the new driver when driver_id changes. Without it the answer is 404, whether the new driver is hidden from the subuser or does not exist. The main account gets 422 under driver_id when the new driver is unknown or cannot be used, the same error as POST /drivers/tags/assignments.

An assignment whose tag has been deleted cannot be changed. The request is refused with 422 and the same error as POST /drivers/tags/assignments gives for that tag, under identification_tag_id.

Request​

Responses​

Assignment updated successfully. Returns the assignment that was changed, in the shape of GET /drivers/tags/{identification_tag_id}/history, whatever the tag is doing now. Editing an assignment that has ended returns that assignment, not the one the tag currently has.