Skip to content

Apply a commit

POST
/v0/namespaces/{namespace}/commits

Applies one commit: an ordered, non-empty list of path operations that commit together as one logical commit, under one commit id that makes retries idempotent. A single-operation call is the one-element case. The first operation that fails aborts the whole request and names its position in details.operation_index.

namespace
required
string

Namespace id

One commit: an idempotency key, an optional annotation, and an ordered list of path operations that commit together (API spec, section 5.1).

A one-operation request is the one-element case of this shape, not a different request: a convenience call and a batch produce the same commit and the same fingerprint.

object
commit_id
required

Caller-supplied idempotency key for the whole request.

string
content_tokens

Proofs for any new external content refs introduced by this request. One proof covers every operation that names its content ref.

Array<object>

Stateless proof that a LoonFS server already validated a content ref.

object
content_ref
required

Content identity the server attests it already verified.

object
content_id
required

Immutable identity of the referenced object.

string
kind
required

Content strategy used by the referenced object.

string
size_bytes
required

Complete byte length of the referenced content.

integer format: int64
storage_checksum
required

Mandatory checksum over the complete object, used to verify the stored bytes against this reference without downloading them.

object
algorithm
required

Algorithm that produced value.

string
Allowed values: sha256 crc64nvme crc32c
value
required

Lowercase hex of the raw checksum bytes.

The algorithm is its own field, so the value carries no prefix. Provider APIs that report base64 are converted at the adapter.

string
whole_file_sha256

SHA-256 over the complete payload, lowercase hex, when a trusted party computed it.

Present means the LoonFS write path hashed the whole stream itself, or a provider validated a signed whole-object SHA-256 on the write. There are no client-claimed digests: absent means nobody trustworthy hashed these bytes, never “the client did not tell us”.

string | null
token
required

Opaque, server-signed token. Clients must not parse it.

string
message

Caller annotation recorded on the commit and reported by the change feed. Part of the commit’s identity: reusing commit_id with a different message is a commit_id_reuse_conflict, exactly as it is for an explicit commit.

string | null
operations
required

Ordered operations to apply. Must be non-empty; they commit all together or not at all.

Array
One of:
FsOpCreateDirectory

Create one directory.

object
kind
required
string
Allowed values: create_directory
parents

Also create missing ancestor directories (the same auto-create put_file performs). The final component must still be new.

boolean
path
required

Absolute destination path, rejected when invalid or already bound.

string

Commit applied

Result of one commit.

Every commit resolves to this envelope — path-oriented operations and explicit commits, embedded or remote. The commit id is the caller’s reconciliation handle: resubmitting the same request with the same id replays this result instead of committing twice.

object
commit_id
required

Idempotency key the commit landed under: caller-supplied, or generated on the caller’s behalf when the request carried none.

string
committed_seq
required

Sequence number where the commit became visible.

integer format: int64
namespace_id
required

Namespace that changed.

string

Invalid commit

HTTP error body used by LoonFS APIs.

object
code
required

Stable machine-readable reason from the ErrorCode registry.

Carried as a string so clients keep working when a newer server introduces a code they do not know; use ErrorCode::parse for typed access.

string
details
One of:
null
feature

For not_supported errors, the capability-document feature key the client should reconcile against.

string | null
message
required

Human-readable error message.

string
request_id

Correlation id the server assigned to the failed request; the same value is sent as the x-request-id response header.

string | null

Unauthorized

HTTP error body used by LoonFS APIs.

object
code
required

Stable machine-readable reason from the ErrorCode registry.

Carried as a string so clients keep working when a newer server introduces a code they do not know; use ErrorCode::parse for typed access.

string
details
One of:
null
feature

For not_supported errors, the capability-document feature key the client should reconcile against.

string | null
message
required

Human-readable error message.

string
request_id

Correlation id the server assigned to the failed request; the same value is sent as the x-request-id response header.

string | null

Namespace or path not found

HTTP error body used by LoonFS APIs.

object
code
required

Stable machine-readable reason from the ErrorCode registry.

Carried as a string so clients keep working when a newer server introduces a code they do not know; use ErrorCode::parse for typed access.

string
details
One of:
null
feature

For not_supported errors, the capability-document feature key the client should reconcile against.

string | null
message
required

Human-readable error message.

string
request_id

Correlation id the server assigned to the failed request; the same value is sent as the x-request-id response header.

string | null

Operation conflict

HTTP error body used by LoonFS APIs.

object
code
required

Stable machine-readable reason from the ErrorCode registry.

Carried as a string so clients keep working when a newer server introduces a code they do not know; use ErrorCode::parse for typed access.

string
details
One of:
null
feature

For not_supported errors, the capability-document feature key the client should reconcile against.

string | null
message
required

Human-readable error message.

string
request_id

Correlation id the server assigned to the failed request; the same value is sent as the x-request-id response header.

string | null

Namespace deleted

HTTP error body used by LoonFS APIs.

object
code
required

Stable machine-readable reason from the ErrorCode registry.

Carried as a string so clients keep working when a newer server introduces a code they do not know; use ErrorCode::parse for typed access.

string
details
One of:
null
feature

For not_supported errors, the capability-document feature key the client should reconcile against.

string | null
message
required

Human-readable error message.

string
request_id

Correlation id the server assigned to the failed request; the same value is sent as the x-request-id response header.

string | null

Commit unavailable

HTTP error body used by LoonFS APIs.

object
code
required

Stable machine-readable reason from the ErrorCode registry.

Carried as a string so clients keep working when a newer server introduces a code they do not know; use ErrorCode::parse for typed access.

string
details
One of:
null
feature

For not_supported errors, the capability-document feature key the client should reconcile against.

string | null
message
required

Human-readable error message.

string
request_id

Correlation id the server assigned to the failed request; the same value is sent as the x-request-id response header.

string | null