Skip to main content
POST
/
api
/
v1
/
ops
/
trip-schedules
/
preview
Preview Trip Schedule
curl --request POST \
  --url https://api.example.com/api/v1/ops/trip-schedules/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "routeId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3c",
  "vehicleId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3d",
  "driverId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3e",
  "name": "São Paulo to Campinas daily morning",
  "frequency": "DAILY",
  "departureAt": "2026-04-15T08:00:00.000Z",
  "stops": [
    {
      "pointId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3c",
      "stopOrder": 0,
      "arrivalOffsetMinutes": 120,
      "departureOffsetMinutes": 135
    }
  ],
  "itineraries": [
    {
      "fromStopOrder": 0,
      "toStopOrder": 1,
      "price": 15000
    }
  ],
  "interval": 1,
  "endAt": "2026-12-31T23:59:59.000Z"
}
'
[
  {
    "status": "MATERIALIZABLE",
    "description": "Driver already booked in this period",
    "departureAt": "2026-04-15T08:00:00.000Z",
    "estimatedArrivalAt": "2026-04-15T14:00:00.000Z"
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

fields
string

Comma-separated list of fields to include in the response. Supports dot notation for nested projection (e.g. id,name,user.email,trips.route.id). Unknown fields are silently dropped.

Body

application/json

Preview trip schedule payload

routeId
string<uuid>
required

Route identifier

Example:

"0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3c"

vehicleId
string<uuid>
required

Vehicle identifier

Example:

"0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3d"

driverId
string<uuid>
required

Driver identifier

Example:

"0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3e"

name
string
required

Trip schedule name

Example:

"São Paulo to Campinas daily morning"

frequency
enum<string>
required

Trip schedule frequency

Available options:
DAILY,
WEEKLY,
MONTHLY
Example:

"DAILY"

departureAt
string<date-time>
required

First scheduled departure

Example:

"2026-04-15T08:00:00.000Z"

stops
object[]
required

Trip schedule stops

Minimum array length: 2
itineraries
object[]
required

Trip schedule itineraries

Minimum array length: 1
interval
integer

Frequency interval

Required range: x > 0
Example:

1

endAt
string<date-time> | null

Optional recurrence end

Example:

"2026-12-31T23:59:59.000Z"

Response

OK

status
enum<string>
required

Materialization status of a candidate trip

Available options:
MATERIALIZABLE,
CONFLICT,
DUPLICATE
Example:

"MATERIALIZABLE"

description
string | null
required

Conflict reason when not materializable

Example:

"Driver already booked in this period"

departureAt
string<date-time>
required

Departure time

Example:

"2026-04-15T08:00:00.000Z"

estimatedArrivalAt
string<date-time>
required

Estimated arrival time

Example:

"2026-04-15T14:00:00.000Z"