> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trysoma.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update secret

> Update an existing secret's value or metadata



## OpenAPI

````yaml api-reference/openapi.json put /api/secret/v1/{secret_id}
openapi: 3.1.0
info:
  title: soma
  version: v1
servers: []
security: []
tags:
  - name: task
    description: >-
      Task management endpoints for creating, listing, and managing tasks and
      their messages
  - name: secret
    description: Secret management endpoints for storing and retrieving encrypted secrets
  - name: encryption
    description: >-
      Encryption key management endpoints for envelope keys, data encryption
      keys, and aliases
  - name: bridge
    description: >-
      Bridge endpoints for managing providers, credentials, functions, and MCP
      protocol communication
  - name: _internal
    description: >-
      Internal endpoints for health checks, runtime configuration, and SDK code
      generation
  - name: a2a
    description: >-
      Agent-to-agent communication endpoints for agent cards, definitions, and
      JSON-RPC requests
  - name: v1
    description: API version v1 endpoints
paths:
  /api/secret/v1/{secret_id}:
    put:
      tags:
        - secret
        - v1
      summary: Update secret
      description: Update an existing secret's value or metadata
      operationId: update-secret
      parameters:
        - name: secret_id
          in: path
          description: Secret ID
          required: true
          schema:
            $ref: '#/components/schemas/WrappedUuidV4'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSecretRequest'
        required: true
      responses:
        '200':
          description: Update secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WrappedUuidV4:
      type: string
      format: uuid
    UpdateSecretRequest:
      type: object
      required:
        - raw_value
      properties:
        raw_value:
          type: string
    Secret:
      type: object
      required:
        - id
        - key
        - encrypted_secret
        - dek_alias
        - created_at
        - updated_at
      properties:
        created_at:
          $ref: '#/components/schemas/WrappedChronoDateTime'
        dek_alias:
          type: string
        encrypted_secret:
          type: string
        id:
          $ref: '#/components/schemas/WrappedUuidV4'
        key:
          type: string
        updated_at:
          $ref: '#/components/schemas/WrappedChronoDateTime'
    Error:
      type: object
      required:
        - message
      properties:
        data: {}
        message:
          type: string
    WrappedChronoDateTime:
      type: string
      format: date-time

````