---
title: "Update Secret Template"
method: PATCH
path: "/agents/v2/secret-templates/{templateId}"
tags: ["Secrets"]
---

# Update Secret Template

`PATCH /agents/v2/secret-templates/{templateId}`

## Request

- Base URL: `https://odyssey.asteroid.ai`
- URL: `https://odyssey.asteroid.ai/agents/v2/secret-templates/{templateId}`
- Auth: API key in header `X-Api-Key`

## Path parameters

- `templateId` string, uuid, required

## Request body

- AgentsVaultUpdateVaultTemplateRequest
  - `description` string
  - `fields` AgentsVaultFieldSpecInput[]
    - `hint` string: Optional guidance shown next to the field, copied from catalog credentials when generating masters.
    - `label` string, required: Human label shown in forms. The field key is UPPER_SNAKE of this label.
    - `required` boolean, required
    - `type` 'username' | 'email' | 'url' | 'phone' | 'text' | 'password' | 'hidden' | 'totp_seed' | 'api_key' | 'card_number' | 'card_expiry' | 'card_cvv' | 'cardholder_name', required: Type of a vault field. Sensitivity is derived from the type: username, email, url, phone, text, card_expiry, and cardholder_name are readable; password, hidden, totp_seed, api_key, card_number, and card_cvv are write-only. There is no separate hidden flag.
  - `kind` 'login' | 'api_key' | 'card' | 'custom': Kind of vault item. Templates and items need at least one field. Completeness is per-field required.
  - `name` string
  - `steps` AgentsVaultTemplateStep[]: How the fields are laid out as steps when someone fills in a secret request.
    - `fieldKeys` AgentsVaultFieldKey[], required: Field keys shown on this step, in order. Each field belongs to at most one step. May be empty only when instructions is set.
    - `instructions` string: Markdown shown above the step's fields
    - `key` string, required: Stable identifier. Lower-case slug, unique within the template.
    - `title` string, required

## Response `200`

The request has succeeded.

- AgentsVaultVaultTemplate: A vault template: an ordered field blueprint. organizationId is omitted on master presets.
  - `actor` CommonActor: Who did something: a person, an API key or one of Asteroid's services. Absent on a record made before actors were stored, on one a system job made, and when the caller may not see who it was.
    - `client` 'web' | 'cli' | 'mcp' | 'astro' | 'sdk': The program a caller used
    - `id` string, required: The person's id, the key's id, or the service's name
    - `kind` 'person' | 'api_key' | 'service', required: The kind of caller that did something
  - `createdAt` string, date-time, required
  - `createdBy` string, uuid
  - `description` string
  - `fields` AgentsVaultFieldSpec[], required
    - `hint` string: Optional guidance shown next to the field, copied from catalog credentials when generating masters.
    - `key` string, required: UPPER_SNAKE field key, unique within a template or item.
    - `label` string, required: Human label shown in forms. The field key is UPPER_SNAKE of this label.
    - `required` boolean, required
    - `type` 'username' | 'email' | 'url' | 'phone' | 'text' | 'password' | 'hidden' | 'totp_seed' | 'api_key' | 'card_number' | 'card_expiry' | 'card_cvv' | 'cardholder_name', required: Type of a vault field. Sensitivity is derived from the type: username, email, url, phone, text, card_expiry, and cardholder_name are readable; password, hidden, totp_seed, api_key, card_number, and card_cvv are write-only. There is no separate hidden flag.
  - `id` string, uuid, required
  - `kind` 'login' | 'api_key' | 'card' | 'custom', required: Kind of vault item. Templates and items need at least one field. Completeness is per-field required.
  - `name` string, required
  - `organizationId` string, uuid
  - `origin` 'generated' | 'manual', required: Whether a vault template was generated from the catalog or created by hand.
  - `sourceTemplateId` string, uuid
  - `steps` AgentsVaultTemplateStep[], required
    - `fieldKeys` AgentsVaultFieldKey[], required: Field keys shown on this step, in order. Each field belongs to at most one step. May be empty only when instructions is set.
    - `instructions` string: Markdown shown above the step's fields
    - `key` string, required: Stable identifier. Lower-case slug, unique within the template.
    - `title` string, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: The server could not understand the request due to invalid syntax.
- `401`: Access is unauthorized.
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `500`: Server error

---

[API](https://skmtc.dev/asteroid/apis/agent-service.md) - [All operations](https://skmtc.dev/asteroid/apis/agent-service/llms.txt) - [OpenAPI document](https://skmtc.dev/asteroid/apis/agent-service/revisions/ccc134d1d510?raw)
