Skip to main content
POST
Create driver event
The Create Driver Event endpoint schedules an event against one of your drivers: a time window, such as vacation, home time, a restart or sick time, when the driver is not available. The dispatch planner shows the event and treats the driver as unavailable for that window. On success it returns the event and its optimistic-concurrency token in the ETag response header. Send that value in the If-Match header of a later Update driver event or Delete driver event request. 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.

Driver

DriverId is the Alvys id of the driver, as returned by Search drivers. It starts with DR; an id that does not is rejected with 400 Bad Request. If the driver does not exist in your account, or it belongs to a subsidiary your credential cannot access, the request is rejected with 404 Not Found. The driver cannot be changed after the event is created.

Event type

EventType is one of Vacation, Restart, SickOrEmergency, Hometime, Other (case-insensitive). Any other value is rejected with 400 Bad Request, and the message lists the allowed values.

Dates are local time at the event address

StartDate and EndDate are wall-clock times at the event Address, not instants. Send them with a zero UTC offset (Z), and write the local time you mean: 2026-12-08T08:00:00Z on a Dallas address means 8:00 AM in Dallas. A value with any other offset, such as -06:00, is rejected with 400 Bad Request, because the offset would be dropped and the event would block a different time than you asked for. StartDate must be before EndDate.

The address must be locatable

Street, City, State and ZipCode are required. Alvys looks the address up to find its time zone, which is what anchors the dates. If the address cannot be found, the request is rejected with 422 Unprocessable Entity and the problem type https://api.alvys.com/errors/UnprocessableEntity/AssetEventAddressNotGeocodable. An event without a location would not block anything in the dispatch planner, so it is refused instead of saved.

Retry safely with ExternalId

ExternalId is your own unique id for the event, such as the id of the time-off request in your HR system. Send the same value when you retry a request, for example after a timeout. If this driver already has an event with that ExternalId, it is returned with 200 OK and no second event is created. Without ExternalId, a retry creates another event.
  • Matching ignores case and surrounding spaces.
  • ExternalId is unique across all driver, truck and trailer events in your account. If it is already used by an event of another asset, the request is rejected with 409 Conflict and the problem type https://api.alvys.com/errors/Conflict/ExternalIdInUse. Make the id specific to the asset and the event, not only to a date.
  • The check protects a retry that follows the first request. Two requests with the same ExternalId sent at exactly the same time can both create an event.

Request parameters

The following parameter is required in the URL path:

Request body


Example cURL request

Replace YOUR_ACCESS_TOKEN with your actual Bearer token.

Response fields

A successful request returns the event. Its current ETag is in the ETag response header.

Example response

201 Created

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 completing the fields for the parameters below. 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>.

Path Parameters

version
string
default:1.0
required

API version (e.g., 1.0)

Example:

"1.0"

Body

DriverId
string
required
EventType
string
required

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

StartDate
string<date-time>
required
EndDate
string<date-time>
required
Address
object
required

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
ExternalId
string | null

Your own unique id for this event, used as an idempotency key. Send the same value if the step runs again and Alvys returns the event the first call created instead of scheduling a second one. Leave blank and a re-run creates another event. Matched case-insensitively and ignoring surrounding whitespace. The check is read-then-insert, so it protects a sequential retry (the normal case, a retry after a timeout) but two genuinely simultaneous requests carrying the same id can both miss it.

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