---
title: "Infer drives between a trip's points"
method: POST
path: "/api/trips/{id}/drives/infer"
tags: ["Transport"]
---

# Infer drives between a trip's points

`POST /api/trips/{id}/drives/infer`

## Request

- Base URL: `https://trvlrr.app`
- URL: `https://trvlrr.app/api/trips/{id}/drives/infer`
- Auth: HTTP bearer

A drive is inferred between consecutive points in one country, bookended by the home current at the time. A drive the person deleted is not recreated. Idempotent.

## Path parameters

- `id` string, required: The trip id.

## Response `200`

Drives added and skipped, with reasons.

- TripDrivesInferred
  - `trip_id` string, required
  - `added_count` integer, required
  - `skipped_count` integer, required
  - `added` InferredDrive[], required
    - `id` string, required
    - `mode` 'drive' | 'other', required: other: a long hop on an upcoming trip, shown as a travel day to book.
    - `from_place` string, required
    - `from_country` string, required
    - `to_place` string, required
    - `to_country` string, required
    - `depart_date` string, required
    - `inferred` 1, required
  - `skipped` SkippedDrive[], required
    - `from_place` string, nullable, required
    - `to_place` string, nullable, required
    - `depart_date` string, nullable, required
    - `reason` 'no_points' | 'inside_stay' | 'same_place' | 'unknown_country' | 'different_countries' | 'covered' | 'dismissed' | 'already_added' | 'too_far', required
  - `removed` string[]: Guessed legs on an upcoming trip that no longer fit and were removed.

## Other responses

- `401`: No usable credential: a Clerk session token, a device token or an OAuth access token is required.
- `403`: The caller may not do this to this account or trip.
- `404`: No such thing, or not one the caller can see.

---

[API](https://skmtc.dev/trvlrr/apis/trvlrr-api.md) · [All operations](https://skmtc.dev/trvlrr/apis/trvlrr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trvlrr/apis/trvlrr-api/revisions/ea024946b293?raw)
