{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-create-vault-request-schema.json",
  "title": "CreateVaultRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-vaults-api-openapi.yml#/components/schemas/CreateVaultRequest",
  "type": "object",
  "required": [
    "name",
    "token_format"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Vault name (slug, 1-64 chars)."
    },
    "token_format": {
      "type": "string",
      "enum": [
        "generic",
        "pan",
        "ssn",
        "email"
      ],
      "description": "Token shape. Format-preserving formats (`pan`, `ssn`, `email`) require a paid plan. A value that looks like a payment card number (13-19 digits after stripping spaces and hyphens, and Luhn-valid) is refused by every format except `pan`."
    },
    "custody_mode": {
      "type": "string",
      "enum": [
        "managed",
        "dual"
      ],
      "default": "managed",
      "description": "Dual-custody vaults support only `token_format` `generic`."
    },
    "default_ttl_seconds": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "description": "Default token lifetime. Omit/null for no expiry."
    },
    "description": {
      "type": "string"
    },
    "metadata_jsonb": {
      "type": "object",
      "additionalProperties": true
    },
    "allowed_destinations": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "Hosts this vault's values may be sent to. Omit or `null` for unrestricted. **Required and non-empty when `token_format` is `pan`.** See the `Vault` schema for the matching rules."
    }
  }
}