Skip to content
中文

Set a workflow vault binding

Attach an entire active vault in your organization to a saved workflow, or replace the vault at an existing alias. Obtain the vault ID or display name from praxis.vault.vaults.list; ambiguous names require an ID. Bindings are independent of published versions and survive archival. The same vault cannot be assigned to two aliases on one definition. Repeating the same assignment is idempotent. Example body: {"vault":"Production"}.

PUT /automation/v1/workflows/{namespace}/{name}/vaults/{alias}

Authentication

Authorization: Bearer $PRAXIS_API_KEY

Request fields

Parameter Type Description
path: namespace string required; Namespace from automation.workflows.list or create; identifies the saved workflow, independently of versions.
path: name string required; Resource name from automation.workflows.list or create; combine with ns to identify the saved workflow.
path: alias string required; Binding alias chosen by the caller: 1–40 lowercase letters, digits or hyphens, beginning with a letter. pattern: "^[a-z][a-z0-9-]{0,39}$"

application/json

no additional fields.

Field Type Description
vault string required; Active vault ID or exact display name from praxis.vault.vaults.list in your organization. Use an ID if display names are duplicated. minLength: 1

Examples

Set these environment variables to your own resources:

Variable Source
WORKFLOW_NAME name returned by creating a workflow
VAULT_ID Active vault ID in the same organization, returned by praxis.vault.vaults.create or list.
: "${WORKFLOW_NAME:?Set WORKFLOW_NAME}"
: "${VAULT_ID:?Set VAULT_ID}"
BODY=$(jq -n --arg VAULT_ID "$VAULT_ID" '{
  "vault": $VAULT_ID
}')
curl --fail-with-body -X PUT "https://api.deepraxis.com/automation/v1/workflows/{namespace}/${WORKFLOW_NAME}/vaults/sample" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  --data "$BODY"
import { createAutomationClient } from '@deepraxis/sdk/automation';

function env(name: string): string {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name}`);
  return value;
}
const automation = createAutomationClient({
  apiKey: env('PRAXIS_API_KEY'),
  baseUrl: 'https://api.deepraxis.com',
  maxRetries: 0,
  timeoutMs: 90_000,
});
const result = await automation.workflows.vaults.set({
  "path": {
    "ns": "docs-samples",
    "name": env("WORKFLOW_NAME"),
    "alias": "sample"
  },
  "body": {
    "vault": env("VAULT_ID")
  }
});
console.log(result);

Response

HTTP 200

Saved binding with available secret names; values are never returned.

application/json

Field Type Description
alias string required; Alias used to identify this whole-vault binding on the script or workflow. pattern: "^[a-z][a-z0-9-]{0,39}$"
vault object required; Bound vault identity and current display name; unavailable vaults use their ID as the fallback name.
vault.id string required; Opaque vault identifier from vault creation or listing; persisted even if the vault becomes unavailable.
vault.name string required; Current vault display name, or the vault ID when its metadata cannot be read.
secrets object[] required; Accessible secret names without values. Empty when metadata cannot be read; check secrets_unavailable.
secrets[].name string required; Lookup name of a non-archived secret in this vault; secret values are never returned.
secrets_unavailable true optional; Present and true when vault or secret metadata could not be read; secrets is then empty. Omitted on success.

Measured response

HTTP 200

{
  "alias": "sample",
  "vault": {
    "id": "vlt_0ab396e275bb47109aacf786b9a49057",
    "name": "sample-vault-1793176670321-396dbf"
  },
  "secrets": [
    {
      "name": "SAMPLE_TOKEN"
    }
  ]
}

Errors

HTTP Codes and description
400 INVALID_PARAMS: Invalid request parameters, path, cursor, or body format.
404 TARGET_NOT_FOUND: The target does not exist or has an incompatible type. VAULT_NOT_FOUND: The vault is missing, foreign, archived or its name is ambiguous; use an active vault ID in your organization.
409 VAULT_ALREADY_BOUND: This vault is already bound to the same definition under another alias; reuse that alias or remove the old binding.
503 SERVICE_UNAVAILABLE: The vault service is unavailable and cannot confirm the requested vault; retry when it recovers.
default Automation problem; inspect the refusal code and diagnostics before retrying.

Authentication and common errors · Retain the X-Request-Id response header for troubleshooting.