files

Reserve Upload

Reserve quota and return a presigned PUT URL for the upload.

The client computes the sha256 ahead of time so the server can dedup against the active set on this workspace. Repeated calls with the same sha256 from the same workspace return 409; when the existing file is in the same context as the request and is uploaded, the 409 body carries it as a top-level existing_file (FileObjectOut) so the SDK can use it instead of uploading again (#1693). An earlier upload that has not completed (reserved) is not handed out, and a duplicate in another context names no file (#1136).

post/api/v1/files/reserve

Request

  • Base URL: https://memory.kagura-ai.com (the document declares no server; this is the origin it was published from)
  • URL: https://memory.kagura-ai.com/api/v1/files/reserve
  • Auth: none declared

Headers

authorizationstring nullable

Request body

workspace_idstring uuid required
context_idstring uuid nullable

Optional owning context (Issue #1136). When set, the caller must have write access to it and the file inherits that context's ACL for all later read/write/list access. Omit for a workspace-scoped file (legacy behaviour: any workspace viewer can download it).

filenamestring required
content_typestring required
size_bytesinteger required
sha256string required

Hex sha256 of the bytes the client will PUT. Accepts upper- or lower-case; the service canonicalizes to lowercase before any storage / dedup / signing use.

Response

Successful Response

file_idunknown required
upload_urlunknown required
expires_atunknown required

Changes

No recorded changes to this operation across all 2 revisions of this API.