Skip to main content
PATCH
Update driver event
The Update Driver Event endpoint applies a partial update to a scheduled driver event. Send only the fields you want to change. A field left out of the body keeps its saved value. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
This endpoint requires the driver:update scope. See Authentication.

If-Match is required

This endpoint uses optimistic concurrency. Send the event’s current ETag in the If-Match header. The ETag response header of Get driver event, of Create driver event, and of every successful update carries it. Search driver events does not return ETags, so get the event by id first.
  • If you omit If-Match, the request is rejected with 428 Precondition Required.
  • If the event changed after you read it, the request is rejected with 412 Precondition Failed. Get the event again and retry with the new ETag.

What you can change

You can change EventType, StartDate, EndDate, Address and Description. The driver cannot be changed: to move an event to another driver, delete it and create a new one. ExternalId cannot be changed. The rules for each field are the same as in Create driver event: dates are local time at the event address and must be sent with a Z offset, and the address must be locatable.

Moving the window

After your changes, the event must still start before it ends. If you send only one of StartDate or EndDate and the result would not, the request is rejected with 422 Unprocessable Entity and the problem type https://api.alvys.com/errors/UnprocessableEntity/AssetEventWindowInverted. Send both dates together when you move the window.

Changing the address

Because the dates are local time at the address, moving an event to an address in another time zone would shift the hours it blocks. If you send Address without the dates and the new address is in a different time zone, the request is rejected with 422 Unprocessable Entity and the problem type https://api.alvys.com/errors/UnprocessableEntity/AssetEventAddressMovesWindow. Send StartDate and EndDate with Address to say what the window should be at the new location.

Events created by maintenance work orders

An event created by a maintenance work order in Alvys follows that work order. It is returned by Get driver event and Search driver events, but it cannot be changed or deleted through the API: the request is rejected with 422 Unprocessable Entity and the problem type https://api.alvys.com/errors/UnprocessableEntity/AssetEventOwnedByWorkOrder. Update the work order instead.

A body with nothing to change

A body with no fields, {}, changes nothing. The request still needs a current If-Match, and it returns 200 OK with the event and its unchanged ETag.

Request parameters

The following parameters are required in the URL path: The following header is required:

Request body

All fields are optional.

Example cURL request

Replace YOUR_ACCESS_TOKEN with your actual Bearer token and the If-Match value with the event’s current ETag.

Response fields

A successful request returns 200 OK with the updated event, in the same shape as Get driver event. The new ETag is in the ETag response header.

Example response

200 OK

Status codes


Rate limits

All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the Rate Limits section. This page is interactive, allowing you to try a request by specifying the API version and the event id in the URL path. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated.

Authorizations

Authorization
string
header
required

OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.

Headers

If-Match
string
required

The event's current ETag (the ETag response header of your most recent GET, POST or PATCH), for optimistic concurrency. Required; if omitted the request is rejected with 428.

Path Parameters

id
string
required
version
string
default:1.0
required

API version (e.g., 1.0)

Example:

"1.0"

Body

EventType
string | null

One of Vacation, Restart, SickOrEmergency, Hometime, Other.

StartDate
string<date-time> | null
EndDate
string<date-time> | null
Address
object | null

Address must be specific enough to resolve to coordinates. Without them the event cannot be anchored to a local time and the dispatch planner ignores it.

Description
string | null

Response

OK

Id
string
required
DriverId
string
required
EventType
string
required
Description
string
required
CreatedAt
string<date-time>
required
StartDate
string<date-time> | null
EndDate
string<date-time> | null
Address
object | null
CreatedBy
string | null
ExternalId
string | null