Skip to main content
POST
/
api
/
v1
/
ops
/
trips
/
{tripId}
/
events
Create Trip Event
curl --request POST \
  --url https://api.example.com/api/v1/ops/trips/{tripId}/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "DRIVER_CHANGED",
  "metadata": {
    "previousDriverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "previousDriverName": "Carlos Silva",
    "previousDriverLicenseNumber": "12345678900",
    "newDriverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "newDriverName": "João Santos",
    "newDriverLicenseNumber": "09876543211"
  },
  "description": "Departure delayed by 15 minutes due to traffic",
  "tripStopId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3c"
}
'
{
  "tripEventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "tripId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "tripStopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "metadata": {},
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

tripId
string<uuid>
required

Trip identifier

Example:

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

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

Create trip event payload

type
enum<string>
required
Available options:
DRIVER_CHANGED
metadata
object
required
description
string | null

Event description

Example:

"Departure delayed by 15 minutes due to traffic"

tripStopId
string<uuid> | null

Trip stop identifier

Example:

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

Response

Created

Eventos operacionais registrados durante uma viagem

tripEventId
string<uuid>
required

Identificador único

tripId
string<uuid>
required

Referência à viagem

tripStopId
string<uuid> | null
required

Referência à parada específica relacionada a TripStop, opcional

type
enum<string>
required

Tipo do evento

Available options:
DRIVER_CHANGED,
VEHICLE_CHANGED,
DEPARTURE_DELAYED,
ARRIVAL_DELAYED,
BOARDING_STARTED,
BOARDING_COMPLETED,
INCIDENT
description
string | null
required

Descrição adicional do evento

metadata
object | null
required

Dados adicionais estruturados

createdBy
string<uuid> | null
required

Usuário que criou o registro, quando aplicável

createdAt
string<date-time>
required

Data de criação

updatedBy
string<uuid> | null
required

Usuário que fez a última atualização, quando aplicável

updatedAt
string<date-time>
required

Data da última atualização