---
search:
  tags:
    - Operations
    - PUT
seo:
  description: >-
    Owner-only, write-only. Stores an encrypted secret value under a name,
    replacing any… Reference for the PUT /app/{id}/secrets endpoint in the
    Charming API API.
sidebar:
  badge: PUT
  label: Create or replace a secret value
title: Create or replace a secret value
type: openapi-operation
---
Owner-only, write-only. Stores an encrypted secret value under a name, replacing any existing secret with the same name. The name must match `^[A-Z][A-Z0-9_]*$` (the same charset a `{{secret:NAME}}` reference uses, so a settable name is always referenceable); values are capped at 8 KiB. The value is never echoed back. Requires the owner's user token; app/render tokens are rejected.

<Operation source="reference" id="upsert-app-secret" />

Found a bug or need a feature? [Tell us](/docs/capabilities/feedback) with `submit_feedback` or `POST /app/{id}/feedback`. Your feedback shapes what we build next.
