Skip to main content
PUT
Write a file

Authorizations

Authorization
string
header
required

An organization-scoped API key, minted in control under Settings → API keys. Every failure to authenticate answers one identical 401: "Provide a valid organization-scoped API key or an active session." Each operation names the one scope it is filed under, <resource>:<read|write>, where the resource is the first path segment after /api/v1/; a key minted today carries all 22 of them. Scopes are RECORDED — on the key and on every audit row — and are not yet enforced: no request is refused for want of one.

Headers

Idempotency-Key
string

Any unique string.

Path Parameters

id
string
required

The ework id. A malformed id answers 404, exactly as another organization's well-formed id does.

Body

application/json
repoId
string
required

Which tier to write. Must be one this ework can reach, and one of yours.

path
string
required

Path from the repository root.

content
string

The text to write. Send exactly one of content or contentBase64.

contentBase64
string

Base64 bytes, for a file that is not text.

expectedSha
string

The sha you last read. The write is refused as a conflict when the file moved since.

Response

Success.

data
object
required