Tearleads

PUT/documents/{documentId}/baseline-stages/{baselineId}/segments/{segmentIndex}/write-header

Re-sign a staged segment's write header

Operation documents.baselineStages.segments.resign

Description

Replaces a staged segment's signed write header without uploading its ciphertext again, for a writer whose staged headers name a manifest, key-target set or signing key that has since changed. The new header must sign the same content record, metadata and ciphertext hashes at the stage's epoch. The stage's byte count moves by the difference between the two headers, and a header that would take it past the stage's bound returns 409 document_baseline_stage_too_large.

Authentication

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

Parameters

NameInTypeDetails
documentIdpathstringrequired
  • pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
baselineIdpathstringrequired
  • lowercase UUID v4
segmentIndexpathintegerrequired
  • 0 to 4,094

Request body

application/jsonDocumentBaselineStageWriteHeaderRequest

A staged segment's write header signed again, for the same ciphertext.

1 field
  • writeHeaderobject with any fieldsrequired

    The new signed write header. It must name the staged segment's content record, metadata hash, ciphertext hash and nonce domain at the stage's epoch.

Other fields are allowed.

Responses

200 OK

application/jsonDocumentBaselineStageStatusResponse

A rotation baseline stage as the server holds it.

7 fields
  • baselineIdstringrequired
    • lowercase UUID v4

    The staged baseline's id.

  • contentKeyCommitmentstringrequired
    • exactly 64 characters
    • lowercase hexadecimal

    Commitment of the content key the stage is for.

  • contentKeyEpochintegerrequired
    • greater than 0

    Content-key epoch the stage is for.

  • expiresAtstringrequired
    • not empty

    When the stage expires unless another segment or header arrives first, as an ISO 8601 instant.

  • nextSegmentIndexintegerrequired
    • 0 to 4,095

    Index the next staged segment must carry, and the index of the final segment a rotating request sends to commit the stage now.

  • segmentsDigeststringrequired
    • exactly 64 characters
    • lowercase hexadecimal

    The baseline digest over the segments staged so far: what a final segment sent now must sign as baselineSegmentsDigest.

  • stagedBytesintegerrequired
    • at least 0

    Bytes the stage stores so far: each staged segment's ciphertext, signed vectors, plaintext hash and write header. A stage holds at most 1 GiB.

Other fields are allowed.

Other responses

StatusMeaningBody
400Bad Request

application/jsonErrorResponse

401Unauthorized

application/jsonSessionFailureResponse

402Payment Required

application/jsonPaymentRequiredErrorResponse

403Forbidden

application/jsonErrorResponse

404Not Found

application/jsonDocumentBaselineStageNotFoundErrorResponse

409Conflict

application/jsonDocumentBaselineStageConflictErrorResponse

413A serialized write header request is limited to 524288 bytes

application/jsonErrorResponse

500Internal Server Error

application/jsonErrorResponse

503Service Unavailable

application/jsonErrorResponse