Decrypt a Vault ciphertext of an organization
POST /v1/vault/decrypt: Decrypt a Vault ciphertext of an organization.
POST /v1/vault/decrypt
Any ciphertext that does not open (another organization, another context, tampered, unknown key) answers vault_decrypt_failed without a reason.
- Scope
vault:use- Auth
- Secret key (
sk_…) - Since
- 1.0
Request body
Section titled “Request body”organizationstring Requiredciphertextstring Requiredmax length 98304
Additional authenticated data bound to the ciphertext; the same pairs are needed to decrypt.contextVaultContext
Responses
Section titled “Responses”- 200 Plaintext VaultDecryptResult
- default Any other error, including internal_error. Every code is in the error catalogue. Error
Errors share one shape; see the error code catalogue.
curl -X POST \ "https://api.ohauthcat.com/v1/vault/decrypt" \ -H "Authorization: Bearer $OHAUTHCAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "organization": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "ciphertext": "example_ciphertext"}'const response = await fetch("https://api.ohauthcat.com/v1/vault/decrypt", { method: "POST", headers: { Authorization: `Bearer ${process.env.OHAUTHCAT_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "organization": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "ciphertext": "example_ciphertext" }),});const data = await response.json();import osimport requests
response = requests.post( "https://api.ohauthcat.com/v1/vault/decrypt", headers={"Authorization": f"Bearer {os.environ['OHAUTHCAT_API_KEY']}"}, json={ "organization": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "ciphertext": "example_ciphertext", },)data = response.json(){ "object": "vault_plaintext", "plaintext": "ZXhhbXBsZQ=="}