---
title: "Import Trip"
method: POST
path: "/v1/webhook/trip-import"
tags: ["Use case / Trip import", "Webhooks / Inbound"]
---

# Import Trip

`POST /v1/webhook/trip-import`

Webhook for planning a list of stops on a trip and assigning resources.

The documented schema is our default input format, but we can also map custom formats,
keeping in mind the limitations that are documented under use cases.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

## Request body

- union
  - TripImportInput
    - `trip_identifier` string, nullable — External identifier for the trip
    - `status` 'CANCELLED'
    - `planned_stops` TripImportStop[], required — List of planned stops in the trip
      - `sequence` integer, required — Sequence number determining the order of stops
      - `id` string, uuid, nullable — ID of the stop in Qargo
      - `location` TripImportLocation
        - `id` string, uuid, nullable — ID of the location in Qargo
      - `custom_fields` object, nullable — Custom fields for the stop
      - `start_timestamp` string, date-time, required — Start timestamp of the stop in UTC
      - `end_timestamp` string, date-time, required — End timestamp of the stop in UTC
      - `fixed_timestamp_type` 'ENFORCED_TIMEWINDOW' | 'SET_BY_USER' | 'CALCULATED'
      - `question_answers` object, nullable — Question answers, format to be defined between Qargo and external party
    - `start_timestamp` string, date-time, nullable — Start timestamp of the trip in UTC
    - `primary_resources` TripImportResource[], nullable — List of primary resources assigned to the trip
      - `id` string, uuid, required — ID of the resource in Qargo
    - `unassigned_stops` TripImportUnassignedStop[], nullable — List of stops that couldn't be assigned to any resource
      - `stop_id` string, uuid, required — ID of the stop that couldn't be assigned
      - `reason` string, nullable — Reason for not being able to assign the stop
    - `failure` ErrorStatus
      - `error_type` 'USER_INPUT_ERROR' | 'INTERNAL_ERROR' | 'NOT_SUPPORTED', required
      - `error_message` string, nullable — (User visible) error message
  - string, binary

## Response `200`

Successful Response

- TripImportResponse
  - `errors` ErrorStatus[], nullable — List of errors that occurred during the webhook processing. If empty/omitted, the webhook was processed successfully.
    - `error_type` 'USER_INPUT_ERROR' | 'INTERNAL_ERROR' | 'NOT_SUPPORTED', required
    - `error_message` string, nullable — (User visible) error message

## Other responses

- `400` — Bad Request — invalid input or malformed request
- `401` — Unauthorized — missing or invalid authentication credentials
- `403` — Forbidden — insufficient permissions for this operation
- `422` — Validation Error
- `429` — Too Many Requests — rate limit exceeded. See the `Retry-After` header
- `500` — Internal Server Error
- `503` — Service Unavailable — temporarily unable to handle the request

---

[API](https://skmtc.dev/qargo/apis/qargo-tms-api.md) · [All operations](https://skmtc.dev/qargo/apis/qargo-tms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qargo/qargo-tms-api/revisions/17297902e7ce/schema)
