Decrypt key

View as Markdown
Samvaad calls this endpoint to decrypt an Encrypted Data Encryption Key (EDEK) using the corresponding master key in your Key Management System (KMS) or HSM. The plaintext key is then cached securely in memory by Samvaad for a short, configurable duration to perform data encryption and decryption operations. The `key_alias` is used to identify which master key should be used for decryption.

Authentication

AuthorizationBearer
A token sent in the `Authorization` header. This can be one of two types: 1. A short-lived **JWT** obtained from the `/auth` endpoint. 2. A long-lived, static **API Key** provided during setup. In both cases, the header format is `Authorization: Bearer <token>`.

Headers

x-request-idstringRequiredformat: "uuid"

A unique identifier for this specific API call, generated by the client (Samvaad).

x-trace-idstringOptionalformat: "uuid"
An identifier to trace a single request across multiple services.
x-request-timestampdatetimeRequired
The ISO 8601 timestamp of when the client sent the request.

Request

The request containing the key alias and the encrypted key data.
dataobjectRequired
The request payload to decrypt a key.

Response headers

X-Request-Idstring
A unique identifier for the request, generated by your service.
X-Trace-Idstring

The identifier for an end-to-end operation, passed from the client to be echoed in the response.

X-Request-Durationinteger
The time in milliseconds the server took to process the request.
X-Response-Timestampstring
The ISO 8601 timestamp of when the response was generated.

Response

The DEK was successfully decrypted.
dataobject
The response payload containing the decrypted key.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error