LOOMAL
SDK / API ReferenceVault

Store Credential

Store or update a credential in the vault

Scope: vault:write

Creates or updates a credential. If a credential with the same name exists, it's overwritten.

Request

import { Loomal } from "@loomal/sdk";

const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });
const credential = await loomal.vault.store("stripe", {
  type: "API_KEY",
  data: { key: "sk_live_abc123..." },
  metadata: { service: "stripe", prefix: "sk_live_...c123" },
});
import os
from loomal import Loomal

loomal = Loomal(api_key=os.environ["LOOMAL_API_KEY"])
credential = loomal.vault.store(
    "stripe",
    type="API_KEY",
    data={"key": "sk_live_abc123..."},
    metadata={"service": "stripe", "prefix": "sk_live_...c123"},
)
loomal vault store stripe \
  --type API_KEY \
  --data '{"key":"sk_live_abc123..."}' \
  --metadata '{"service":"stripe","prefix":"sk_live_...c123"}'
vault.store(name="stripe", type="API_KEY", data={...}, metadata={...})

Available through @loomal/mcp — see MCP setup.

curl -X PUT https://api.loomal.ai/v0/vault/stripe \
  -H "Authorization: Bearer loid-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "API_KEY",
    "data": { "key": "sk_live_abc123..." },
    "metadata": { "service": "stripe", "prefix": "sk_live_...c123" }
  }'

Body

FieldTypeRequiredDescription
typestringYesOne of: LOGIN, API_KEY, OAUTH, TOTP, SSH_KEY, DATABASE, SMTP, AWS, CERTIFICATE, CUSTOM
dataobjectYesSecret fields (encrypted at rest)
metadataobjectNoNon-secret fields (stored as plaintext for display)
expiresAtstringNoExpiry date (ISO 8601)

Response

{
  "credentialId": "cred_abc123",
  "type": "API_KEY",
  "name": "stripe",
  "metadata": { "service": "stripe", "prefix": "sk_live_...c123" },
  "expiresAt": null,
  "createdAt": "2026-03-29T03:00:00Z"
}

Examples

Store a login

curl -X PUT https://api.loomal.ai/v0/vault/github \
  -H "Authorization: Bearer loid-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "LOGIN",
    "data": { "password": "s3cret!" },
    "metadata": { "uri": "https://github.com", "username": "agent-bot" }
  }'

Store a TOTP secret

curl -X PUT https://api.loomal.ai/v0/vault/github-2fa \
  -H "Authorization: Bearer loid-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "TOTP",
    "data": { "secret": "JBSWY3DPEHPK3PXP" },
    "metadata": { "issuer": "GitHub", "account": "agent-bot" }
  }'

On this page