Tearleads

POST/blobs/{blobId}/attachment-bindings

Bind or replace a blob attachment

Operation blobs.attachmentBindings.bind

Description

Attaches an encrypted blob to an attachment slot in a document, or replaces the slot's current binding, through a signed attachment.bind event. When it names a blob stage, the server assembles and verifies the staged upload and promotes it to committed blob storage; this is the only way to complete an upload. Requires write access through an authorizing container path; a stale binding or path head returns 409, and an organization without active billing returns 402.

Authentication

Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.

Parameters

NameInTypeDetails
blobIdpathstringrequired

Request body

application/jsonBlobAttachmentBindRequest

A signed attachment.bind: puts a blob in a document slot, optionally completing a blob stage and committing the document's first update.

7 fields

Other fields are allowed.

Responses

200 OK

application/jsonBlobAttachmentBindResponse

Acknowledges a bind by hash, so the client can compare it with what it signed.

11 fields
  • bindingIdstringrequired
  • blobIdstringrequired
  • blobKekTargetsBlobKekTargetsResponserequired
  • contentKeyEpochintegerrequired
    • greater than 0

    Content-key epoch the API stored for the blob.

  • documentIdstringrequired
  • documentManifestHashstringrequired

    Document link-set manifest head the bind was checked against.

  • eventHashstringrequired
    • not empty

    Hash of the signed bind event.

  • previousBindingIdstringrequirednullable

    Binding this one replaced in the slot, or null.

  • slotIdstringrequired
  • writeHeaderHashstringrequired

    Hash of the stored blob write header.

  • documentSyncobjectoptional

    Present exactly when the request carried documentSync; names the accepted update.

    3 fields
    • acceptedOutgoingUpdateIdslist of stringrequired
      • at most 1 item
      • each item: not empty
    • commitLsnstringrequirednullable
    • commitLsnModestringrequired
      • one of tracked, untracked

    Other fields are allowed.

Other fields are allowed.

Other responses

StatusMeaningBody
400Bad Request

application/jsonErrorResponse

401Unauthorized

application/jsonSessionFailureResponse

402Payment Required

application/jsonPaymentRequiredErrorResponse

403Forbidden

application/jsonErrorResponse

404Not Found

application/jsonErrorResponse

409Conflict

application/jsonBlobMutationFailureResponse

500Internal Server Error

application/jsonErrorResponse

503Service Unavailable

application/jsonErrorResponse

Additional rules

The server also enforces these rules, which the schema above cannot express.

  • An attachment bind's document sync must contain exactly one outgoing update and no container rekeys, and serialize within the document sync request limit.

  • inlineRekeyCommitId must be present exactly when containerRekeys is non-empty.

  • authorizingContainerPathRefs is required when outgoingUpdates is non-empty.

  • containerRekeys may be non-empty only when outgoingUpdates is non-empty.

  • Outgoing update ids must be unique within the request.

  • A request carrying pullCursor must not contain outgoing updates, container rekeys, a content-key bundle, or authorizing paths.

  • historyMode "raw" must not be combined with outgoing updates, container rekeys, a content-key bundle, or authorizing paths.

  • historyMode "raw" requires localVersionVector to be null so the complete retained history is requested.

  • checkpointKind, checkpointPayloadKind, and sourceVersionVector must be absent together or form a rotation baseline.