---
title: "Update a document"
method: PATCH
path: "/api/v1/trips/{tripExternalId}/documents/{documentExternalId}"
tags: ["Documents"]
---

# Update a document

`PATCH /api/v1/trips/{tripExternalId}/documents/{documentExternalId}`

## Request

- Base URL: `https://www.endlesstravelplans.com`
- URL: `https://www.endlesstravelplans.com/api/v1/trips/{tripExternalId}/documents/{documentExternalId}`
- Auth: HTTP bearer

Share it with the trip's collaborators or make it private again, rename it, change its type or edit its
notes. Send any of the four fields, at least one; only the fields sent change, and `notes: null` clears the
notes. An empty body is 422 `validation_failed`. Uploader or trip owner only.

## Request body

- object
  - `shared_with_trip` boolean: Share with the trip's accepted collaborators (true) or keep private (false).
  - `name` string: At most 255 characters.
  - `document_type` string: One of passport, visa, boarding_pass, hotel_confirmation, insurance, car_rental, other.
  - `notes` string, nullable: nullable At most 1000 characters; null clears them.

## Response `200`

- object
  - `document` object
    - `external_id` string
    - `trip_id` integer
    - `document_type` string
    - `name` string
    - `file_url` string
    - `mime_type` string
    - `notes` string
    - `shared_with_trip` boolean
    - `uploaded_by` object
      - `id` integer
      - `first_name` string
    - `can_delete` boolean
    - `can` object
      - `update` boolean
      - `delete` boolean
      - `share` boolean
    - `size_bytes` integer
    - `created_at` string
    - `updated_at` string

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `422`: validation_failed: The request body failed validation; field messages are in `errors`.
- `429`: rate_limited: A throttle or a per-account allowance refused the request; `retry_after` or `remaining` may be present.
- `500`: server_error: Unhandled failure; quote `request_id` to support.

---

[API](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api.md) · [All operations](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/llms.txt) · [OpenAPI document](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/revisions/ae82ed3e4a8f?raw)
