Update key store
/key-store/{id}
Team admins only (signed-in users; API tokens get 403). A changed config or credentials replaces the stored one; credentials left out are kept. The location (for AWS: the account the credentials belong to, the region and secret_name_prefix) can't change (400); create a new key store instead. On a store that holds nothing and isn't current, a change puts it back to connecting. On the current store, or one accounts already use, the change is verified before it is saved (400 if that fails) and the store is active. A config sent back unchanged is not a change (a rename only). A new kms_key_id applies to secrets created after the change. is_current: false disables the store: new secrets stop going to it, and what is in it stays. is_current: true on a store that isn't current is refused (400): use POST /key-store/{id}/activate, which verifies it first.
Path Parameters
Request Body
Replaces the stored credentials. Never returned.
false disables the store. Use POST /key-store/{id}/activate to make it current.
Response Body
Non-secret settings; the fields per provider are listed by GET /key-store-provider. For aws_secrets_manager: region, secret_name_prefix (default truto/; each account is stored at <prefix><environment_id>/<integrated_account_id>, its integration_override at <prefix><environment_id>/<integrated_account_id>/integration-override, and an environment integration's override at <prefix><environment_id>/environment-integration/<environment_integration_id>), an optional kms_key_id, and account_id / partition, which Truto reads from AWS for the store's credentials. The store's credentials are write-only and never returned.
When the key store last stopped being current (UTC). It can be deleted a minute after this. Null if it was never current.
The environment whose secrets live in this store. An environment can have many key stores, at most one active.
Whether this is the environment's current key store (at most one): new and updated secrets in the environment are written to it; existing ones move on their next write, or all at once with POST /key-store/{id}/move-secrets. A store that isn't current keeps serving what is already in it. A current store whose verification fails stays current: its secrets are only there.
Why the last verification failed.
When verification last succeeded (UTC).
The store. aws_secrets_manager: AWS Secrets Manager, with secrets encrypted by the customer's KMS key when config.kms_key_id is set.
aws_secrets_manager
Whether the store works, like an integrated account's status. connecting: created, or its settings changed while it holds nothing; not proven yet, and nothing is written to it. active: the last POST /key-store/{id}/verify passed. validation_error: the last verification failed (why is in last_error); a verification that passes sets it back to active. Which store is used is is_current.
connectingactivevalidation_error
curl -X PATCH 'https://api.truto.one/key-store/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "your_name",
"config": {},
"credentials": {},
"is_current": true
}'const body = {
"name": "your_name",
"config": {},
"credentials": {},
"is_current": true
};
const response = await fetch('https://api.truto.one/key-store/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/key-store/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"name": "your_name",
"config": {},
"credentials": {},
"is_current": True
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())