Skip to content

Uploads: replace a file in place, and say which file each version is - #433

Open
jeremy wants to merge 1 commit into
masterfrom
upload-versions-api
Open

Uploads: replace a file in place, and say which file each version is#433
jeremy wants to merge 1 commit into
masterfrom
upload-versions-api

Conversation

@jeremy

@jeremy jeremy commented Aug 5, 2026

Copy link
Copy Markdown
Member

Documents a new endpoint for replacing an upload's file, and corrects the
existing versions documentation.

New: Create an upload version

POST /uploads/2/versions.json replaces the file of an existing upload. The
upload keeps its ID, its URL and its comments, and the previous file stays
available as a past version.

Until now the only way to publish a new file was POST /vaults/2/uploads.json,
which creates a new upload with a new ID and a new URL. If you're shipping
successive releases of the same artifact, that means a folder filling up with
app-v0.8.1.exe, app-v0.8.2.exe, … and a download link that has to change
every time. Use the new endpoint when you want the link to keep working.

Takes the same attachable_sgid as Create an
attachment
, plus optional
base_name, description, notify and subscriptions. Returns 201 Created
with the upload's JSON representation.

description is presence-aware: omit it to carry the previous version's
description forward, or send "" or null to clear it.

notify and subscriptions control who hears about the replacement, the same
way they do elsewhere in the API: default notifies people subscribed to
project notifications, everyone notifies the whole project, and custom
notifies the people named in subscriptions. Omit both to notify nobody.
Notified people are subscribed to the upload. Client visibility isn't a
parameter here — a replacement never changes who can see an upload, so clients
are in the audience only when the upload is already visible to them.

The project-scoped POST /buckets/1/uploads/2/versions.json also works and is
listed under the legacy routes.

Corrected: Get upload versions

The previous text said "Each version event represents a file replacement."
That was wrong — as the example response directly beneath it showed, with
"action": "created".

Three actions appear: created and active mark the upload's publication, and
blob_changed marks a file replacement. Filter on blob_changed to list only
replacements.

New: the upload object on version events

Version events previously carried event metadata only, so you could tell that
something changed but not which file. Each version event now includes an
upload object:

  • filename, content_type and byte_size — the file as it was at that
    version.
  • download_url — that specific version's file. The upload's own download_url
    always serves the latest.
  • app_download_url — the equivalent link for the Basecamp web app.
  • currenttrue for the most recent version, false for the rest.

One nuance worth reading before you rely on current: it means the newest
version, which isn't necessarily the file you get from the upload's own
download_url. Updating an upload changes its metadata without recording a new
version, so the two can differ. The documentation says this explicitly.

Also: Update an upload's parameters

Update an upload never listed what it
accepts. It takes base_name and description, and it changes metadata only —
the file itself is replaced through the new versions endpoint. Sending "" for
base_name keeps the current name; sending "" or null for description
clears it.

This is an additive change. Existing fields are unchanged.


Synced from bc3 doc/api/ by script/api/sync_to_bc3_api — not a hand-edit.

Copilot AI balanced review requested due to automatic review settings August 5, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 5, 2026 20:09
@jeremy
jeremy force-pushed the upload-versions-api branch from cdea8ec to 38479ac Compare August 5, 2026 20:09
@jeremy

jeremy commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Updated: both create endpoints now document the 507 Insufficient Storage returned when an account has reached its storage limit. Replacing a file stores the new version alongside every past one, so it counts against storage — and creating an upload could already return this, it just wasn't written down.

Synced from bc3 doc/api/ by script/api/sync_to_bc3_api — not a hand-edit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 5, 2026 21:29
@jeremy
jeremy force-pushed the upload-versions-api branch from 38479ac to 5d6cda9 Compare August 5, 2026 21:29
@jeremy

jeremy commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Updated: documents that the upload object is omitted — not null — on a version whose file has since been removed from the account. The version event itself is still listed, so decode upload as optional.

Synced from bc3 doc/api/ by script/api/sync_to_bc3_api — not a hand-edit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 6, 2026 07:35
@jeremy
jeremy force-pushed the upload-versions-api branch from 5d6cda9 to f7be88e Compare August 6, 2026 07:35
@jeremy

jeremy commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Re-synced onto current master and re-pinned to the source repo's master.

The earlier revision of this branch predated a follow-up that settled the endpoint's input contract, so it would have published docs that omit behavior already live: notify and subscriptions on a replacement, "" (not just null) as a description clear, and the parameter list for Update an upload. sections/uploads.md is now byte-identical to the source repo's doc/api/sections/uploads.md, and it is the only file this branch touches.

Synced from bc3 doc/api/ by script/api/sync_to_bc3_api — not a hand-edit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants