curl -X PUT "https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets" \
-H "Authorization: Bearer runtm_xxx" \
-H "X-Organization-Id: org_abc123" \
-H "Content-Type: application/json" \
-d '{
"secrets": {
"DATABASE_URL": "postgres://user:pass@host:5432/db",
"API_SECRET": "sk-secret-value"
}
}'
import requests
response = requests.put(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets",
headers={
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
"Content-Type": "application/json",
},
json={
"secrets": {
"DATABASE_URL": "postgres://user:pass@host:5432/db",
"API_SECRET": "sk-secret-value",
}
},
)
data = response.json()
print(f"Configured: {data['secrets']}")
print(f"All required set: {data['has_all_required']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets",
{
method: "PUT",
headers: {
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
"Content-Type": "application/json",
},
body: JSON.stringify({
secrets: {
DATABASE_URL: "postgres://user:pass@host:5432/db",
API_SECRET: "sk-secret-value",
},
}),
}
);
const data = await response.json();
console.log(`Configured: ${data.secrets.join(", ")}`);
{
"secrets": ["DATABASE_URL", "API_SECRET"],
"required_secrets": ["DATABASE_URL", "API_SECRET", "REDIS_URL"],
"has_all_required": false
}
Secrets
Update Template Secrets
Set or update secrets for a template
PUT
/
api
/
org-templates
/
{template_id}
/
secrets
curl -X PUT "https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets" \
-H "Authorization: Bearer runtm_xxx" \
-H "X-Organization-Id: org_abc123" \
-H "Content-Type: application/json" \
-d '{
"secrets": {
"DATABASE_URL": "postgres://user:pass@host:5432/db",
"API_SECRET": "sk-secret-value"
}
}'
import requests
response = requests.put(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets",
headers={
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
"Content-Type": "application/json",
},
json={
"secrets": {
"DATABASE_URL": "postgres://user:pass@host:5432/db",
"API_SECRET": "sk-secret-value",
}
},
)
data = response.json()
print(f"Configured: {data['secrets']}")
print(f"All required set: {data['has_all_required']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets",
{
method: "PUT",
headers: {
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
"Content-Type": "application/json",
},
body: JSON.stringify({
secrets: {
DATABASE_URL: "postgres://user:pass@host:5432/db",
API_SECRET: "sk-secret-value",
},
}),
}
);
const data = await response.json();
console.log(`Configured: ${data.secrets.join(", ")}`);
{
"secrets": ["DATABASE_URL", "API_SECRET"],
"required_secrets": ["DATABASE_URL", "API_SECRET", "REDIS_URL"],
"has_all_required": false
}
Bulk upserts secrets for a template. Values are encrypted before storage. Existing secrets with the same key are overwritten. Requires admin or owner role.
Required scope:
secrets:write
Path Parameters
string
required
The template ID (e.g.
tmpl_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxstring
required
Organization ID.
Body
object
required
Key-value map of secret names to values.
Response
array
Updated list of configured secret key names.
boolean
Whether all required secrets are now configured.
curl -X PUT "https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets" \
-H "Authorization: Bearer runtm_xxx" \
-H "X-Organization-Id: org_abc123" \
-H "Content-Type: application/json" \
-d '{
"secrets": {
"DATABASE_URL": "postgres://user:pass@host:5432/db",
"API_SECRET": "sk-secret-value"
}
}'
import requests
response = requests.put(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets",
headers={
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
"Content-Type": "application/json",
},
json={
"secrets": {
"DATABASE_URL": "postgres://user:pass@host:5432/db",
"API_SECRET": "sk-secret-value",
}
},
)
data = response.json()
print(f"Configured: {data['secrets']}")
print(f"All required set: {data['has_all_required']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/secrets",
{
method: "PUT",
headers: {
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
"Content-Type": "application/json",
},
body: JSON.stringify({
secrets: {
DATABASE_URL: "postgres://user:pass@host:5432/db",
API_SECRET: "sk-secret-value",
},
}),
}
);
const data = await response.json();
console.log(`Configured: ${data.secrets.join(", ")}`);
{
"secrets": ["DATABASE_URL", "API_SECRET"],
"required_secrets": ["DATABASE_URL", "API_SECRET", "REDIS_URL"],
"has_all_required": false
}