Skip to main content
POST
Create trailer event
The Create Trailer Event endpoint schedules an event against one of your trailers: a time window, such as a repair or other shop time, when the trailer is not available. The dispatch planner shows the event and treats the trailer 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 trailer event or Delete trailer 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 trailer:update scope. See Authentication.

Trailer

TrailerId is the Alvys id of the trailer, as returned by Search trailers. It starts with TL; an id that does not is rejected with 400 Bad Request. If the trailer 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 trailer cannot be changed after the event is created. Title is set by Alvys to the trailer number, the same as on an event created in Alvys.

Event type

EventType is one of WorkOrder, Repair, 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 your shop’s repair order number. Send the same value when you retry a request, for example after a timeout. If this trailer 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

TrailerId
string
required
EventType
string
required

One of WorkOrder, Repair, 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
TrailerId
string
required
Title
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