Register a customer-managed AWS KMS key as the scope's new active version
POST /v1/encryption_keys: Register a customer-managed AWS KMS key as the scope's new active version.
POST /v1/encryption_keys
Enterprise. The key must be a full AWS KMS key ARN whose key policy grants our service role kms:Encrypt and kms:Decrypt pinned to this environment’s encryption context (GET /v1/encryption_keys/setup). A test encrypt and decrypt runs first; a key that also works under another environment’s context is refused (encryption_key_policy_too_broad). The new version becomes active, the previous one stays readable, and every sealed secret of the scope is re-sealed in the background.
- Scope
encryption_keys:write- Auth
- Secret key (
sk_…) - Since
- 1.0
Request body
Section titled “Request body”
Full AWS KMS key ARN (single- or multi-Region); aliases are refused.key_arnstring Requiredmin length 20 · max length 256
Register an organization key instead of the environment-wide key.organizationstring
Responses
Section titled “Responses”- 201 Registered and active EncryptionKey
- 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/encryption_keys" \ -H "Authorization: Bearer $OHAUTHCAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "key_arn": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"}'const response = await fetch("https://api.ohauthcat.com/v1/encryption_keys", { method: "POST", headers: { Authorization: `Bearer ${process.env.OHAUTHCAT_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "key_arn": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" }),});const data = await response.json();import osimport requests
response = requests.post( "https://api.ohauthcat.com/v1/encryption_keys", headers={"Authorization": f"Bearer {os.environ['OHAUTHCAT_API_KEY']}"}, json={ "key_arn": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", },)data = response.json(){ "id": "ekey_01J9ZQ4M7K2X8V3N5B6C1D0E9F", "object": "encryption_key", "scope": "environment", "organization": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "version": 1, "provider": "aws_kms", "key_arn": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "state": "active", "last_error": "saml_signature_invalid", "created_at": "2026-01-15T09:30:00Z", "validated_at": "2026-01-15T09:30:00Z", "deprecated_at": "2026-01-15T09:30:00Z", "revoked_at": "2026-01-15T09:30:00Z"}