bymundi API

Update a document

PATCH/v1/documents/{documentId}

Renames a document, releases it to the trip's travelers (visibility: traveler) or takes it back to internal (staff), and files it in a folder (folderId; null = loose) — the Documents tab's Make visible, Back to internal and Move to folder, in one write. Travelers see a released document only while the trip is published (visibleToTravelersNow). Pass the updatedAt you read, exactly as you read it, as expectedUpdatedAt to refuse a stale write with a 409. Undo with POST /changes/{changeId}/revert.

Permissions: documents:write · Kind: write · Cost: 1 unit · MCP tool update_document

Undoable: the response carries Bymundi-Change-Id; revert it with POST /v1/changes/{changeId}/revert.

Path parameters

Field Type Required Description
documentId uuid yes

Body

Field Type Required Description
name string The name shown in bymundi, with its extension (e.g. 'Kyoto hotel voucher.pdf'). max 200 chars
visibility "staff" | "traveler"
folderId uuid | null A folder of the same trip; null = loose (in no folder).
expectedUpdatedAt datetime The document's updatedAt as you read it.

Response 200

Field Type Required Description
object "document" yes
id uuid yes
tripId uuid yes
folderId uuid | null yes The folder it is filed in; null = loose (in no folder).
name string yes
mimeType string yes
byteSize integer yes ≥ 0
status "pending" | "ready" yes pending: reserved, the upload is not complete — never listed. ready: a document.
visibility "staff" | "traveler" yes staff: internal, only the agency sees it. traveler: released to the trip's travelers.
visibleToTravelersNow boolean yes Released AND the trip is published: the traveler's app shows it right now.
visibleAt string | null yes When it was last released to travelers; null while internal.
visibleBy object | null yes
visibleBy.id string yes
visibleBy.name string | null yes
uploadedBy object | null yes
uploadedBy.id string yes
uploadedBy.name string | null yes
createdAt string yes
updatedAt string yes
appUrl string | null yes The trip's Documents tab in bymundi.

Errors

Errors are problem details. Besides the refusals described above, any call like this one can return: