---
title: "Update a Secret"
method: PUT
path: "/secrets/{id}"
tags: ["Secrets"]
---

# Update a Secret

`PUT /secrets/{id}`

Update an existing secret.

## Path parameters

- `id` string, required

## Request body

- union — The fields to update
  - union
    - UpdateBasicAuthSecretRequestDto
      - `type` 'basic'
      - `header_name` string — Custom header name for authentication.
      - `provider` string — The provider/credential name.
      - `username` string — The username for basic authentication.
      - `password` string, nullable — The password for basic authentication.
    - UpdateBearerAuthSecretRequestDto
      - `type` 'bearer'
      - `header_name` string — Custom header name for authentication.
      - `provider` string — The provider/credential name. If changed, the secret will be replaced.
      - `token` string, nullable — The bearer token for authentication.
    - UpdateApiKeyAuthSecretRequestDto
      - `type` 'api_key'
      - `header_name` string — Custom header name for the API key.
      - `provider` string — The provider/credential name.
      - `api_key` string, nullable — The API key for authentication.
  - union
    - UpdateSecretOpenAIRequestDto
      - `api_key` string, nullable — The API key for OpenAI/Azure OpenAI authentication.
      - `model` string — The OpenAI model to use
      - `endpoint` string — The OpenAI API endpoint URL
      - `isStreaming` boolean — Whether to use streaming for LLM responses
      - `maxMessages` number, double — Maximum number of messages to include in the conversation
      - `provider` 'external-openai' — The provider type for OpenAI
    - UpdateSecretAzureOpenAIRequestDto
      - `api_key` string, nullable — The API key for OpenAI/Azure OpenAI authentication.
      - `model` string — The OpenAI model to use
      - `endpoint` string — The OpenAI API endpoint URL
      - `isStreaming` boolean — Whether to use streaming for LLM responses
      - `maxMessages` number, double — Maximum number of messages to include in the conversation
      - `provider` 'external-azure-openai' — The provider type for Azure OpenAI
      - `version` string — The version of the Azure OpenAI API to use

## Response `200`

Updated

- SanitizedSecretDto
  - `id` string, required
  - `provider` string, required
  - `type` 'bearer' | 'api_key' | 'basic' | 'oauth2', required — Authentication types supported by the secrets service
  - `created_at` string, required
  - `last_used_at` string, required
  - `sanitized_secret` string, required
  - `config` string

## Other responses

- `404` — NotFoundError

---

[API](https://skmtc.net/d-id/apis/realtime-endpoints.md) · [All operations](https://skmtc.net/d-id/apis/realtime-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/d-id/realtime-endpoints/versions/2f2425e1b6b6/schema)
