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

# Set secret value

> Sets a secret's value, either the project-wide default or, with `environmentAlias`, an override on one environment version (`draft` unless `versionVariant` says otherwise). The value is write-only and never read back; MCP clients cannot call this.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json put /v1/stable/secret/{secretID}/value
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/secret/{secretID}/value:
    put:
      tags:
        - Secret
      summary: Set secret value
      description: Sets a secret's value, either the project-wide default or, with
        `environmentAlias`, an override on one environment version (`draft`
        unless `versionVariant` says otherwise). The value is write-only and
        never read back; MCP clients cannot call this.
      operationId: StableSecretController_setValue
      parameters:
        - name: secretID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the secret to operate on.
          description: The ID of the secret to operate on.
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableSecretValueRequest"
      responses:
        "200":
          description: Confirms the value was stored. The body is a message only, so
            refetch the secret to see `hasValue`, or the override list to see
            the environment carrying it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableUpdateResponse"
          x-vf-doc:
            description: Confirms the value was stored. The body is a message only, so
              refetch the secret to see `hasValue`, or the override list to see
              the environment carrying it.
      security:
        - token: []
components:
  schemas:
    StableSecretValueRequest:
      type: object
      properties:
        value:
          type: string
          minLength: 1
          description: The secret value to store. Write-only — it can never be read back
            through this API.
        environmentAlias:
          description: Set the value as an override on this environment (e.g. `main`)
            instead of as the project-wide default.
          type: string
          minLength: 1
        versionVariant:
          description: Which version of the environment the override applies to. Defaults
            to `draft`. Ignored without `environmentAlias`.
          allOf:
            - $ref: "#/components/schemas/VersionVariant"
      required:
        - value
      additionalProperties: false
    VersionVariant:
      type: string
      enum:
        - draft
        - published
      x-enumNames:
        - DRAFT
        - PUBLISHED
    StableUpdateResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message confirming the update.
      required:
        - message
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
