Files

Replaces the file content (multipart 'file'); same type rules and limits as upload. Keeps link, password, TTL and tags. For an HTML or Markdown file published as a page, replaces that page (same rules as PUT /api/html). HTML or Markdown over an existing file makes it a page at the same address, keeping owner, password, TTL, tags and views.

put/api/files/{ns}/{id}

Request

  • Base URL
    https://brewpage.app
  • Auth
    • API key in header X-Owner-Token
    • or API key in header X-Manage-Key

Path parameters

ns, string required
id, string required

Query parameters

ttl, string

Not part of the update contract: updates keep the original expiry.

format, string

Format of a page published from this file: decides over the file name. Unknown values are ignored.

Headers

X-Owner-Token, unknown

Owner token returned at creation

X-Manage-Key, unknown

Management key of this publication

Request body multipart/form-data

object required
file, string binary

File part; any single file part is accepted when 'file' is absent

Response

File replaced

FileUpdateResponse required

Replace result. For a file published as a page (notice 'html-file-as-page', 'markdown-file-as-page' or 'file-format-applied') the page was replaced

id, string required
namespace, string required
filename, string required

Stored name of the new content

contentType, string

Detected MIME type of the new content

sizeBytes, integer required
link, string required
ownerLink, string required
expiresAt, string date-time required

Unchanged: updates keep the original expiry

listed, boolean required

true = listed in the gallery and sitemap now (public, no password, not hidden).

listable, boolean required

false = never listed in the gallery whatever the namespace (JSON and KV, JSON pages, HTML and JSON files); listing does not apply

notices, PublishNotice[]

Advisories about the request or its result; omitted when none.

Changes

    • info

      added the optional property level to the response with the status

    • info

      added the optional property level to the response with the status

    • info

      added the optional property level to the response with the status

    4 more changes in this revision