Tearleads

GET/auth/device-state/keys

Read the caller's key envelopes

Operation auth.deviceState.keys

Description

Returns what only the signed-in user's own devices need from the head of their device chain: the key epoch wrapped to each active device and to the recovery key, and the sealed keyring of earlier key epochs. A device unwraps its own envelope and checks the result against the verified chain. A user with no chain returns 404.

Authentication

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

Responses

200 OK

application/jsonUserDeviceKeysResponse

The head state's key envelopes and sealed keyring, for the user's own devices.

3 fields
  • headobjectrequired

    The state these artifacts belong to.

    3 fields
    • stateHashstringrequired
      • exactly 64 characters
      • lowercase hexadecimal

      Hash of the head state.

    • userIdstringrequired
      • lowercase UUID v4
    • versionintegerrequired
      • 1 to 8,192

      Version of the head state.

    Other fields are allowed.

  • keyEnvelopeslist of objectrequired
    • at most 33 items

    One envelope per active device and one for recovery.

    A key epoch's secret wrapped to one active device or to the root recovery key.

    5 fields
    • deviceIdstringrequirednullable
      • lowercase UUID v4

      The recipient device; null for the recovery envelope.

    • kemCipherTextstringrequired
      • exactly 2,092 characters
      • base64, pattern ^(?:[A-Za-z0-9+/]{4}){522}[A-Za-z0-9+/]{2}[AEIMQUYcgkosw048]=$

      Base64 ML-KEM-1024 ciphertext.

    • recipientKeyFingerprintstringrequired
      • exactly 64 characters
      • lowercase hexadecimal

      SHA-256 fingerprint of the recipient's encapsulation key.

    • recipientKindstringrequired
      • one of device, recovery

      device or recovery.

    • wrappedKeystringrequired
      • exactly 64 characters
      • base64, pattern ^(?:[A-Za-z0-9+/]{4}){16}$

      Base64 AES-256-GCM wrap of the 32-byte key epoch secret.

    Other fields are allowed.

  • sealedUserKeyringobjectrequirednullable

    Null at key epoch 1.

    Every earlier key epoch's secret, sealed under the current key epoch so a newly paired device reads retained history.

    7 fields
    • ivstringrequired
      • exactly 16 characters
      • base64, pattern ^(?:[A-Za-z0-9+/]{4}){4}$

      Base64 AES-GCM IV.

    • keyEpochintegerrequired
      • 2 to 4,096

      The key epoch that seals the keyring; at least 2.

    • sealedstringrequired
      • at most 349,472 characters

      Base64 ciphertext whose length is fixed by keyEpoch: an 8-byte header and 64 bytes per earlier epoch, plus the tag.

    • sealingSuitestringrequired
      • always tearleads.user-keyring.aes-256-gcm.v1

      The sealing algorithm.

    • userEncryptionKeyFingerprintstringrequired
      • exactly 64 characters
      • lowercase hexadecimal

      SHA-256 fingerprint of the sealing epoch's user encryption key.

    • userIdstringrequired
      • lowercase UUID v4
    • versionnumberrequired
      • always 1

      Keyring format version, 1.

    Other fields are allowed.

Other fields are allowed.

Other responses

StatusMeaningBody
401Unauthorized

application/jsonSessionFailureResponse

404Not Found

application/jsonErrorResponse

500Internal Server Error

application/jsonErrorResponse

503Service Unavailable

application/jsonErrorResponse