---
search:
  tags:
    - Operations
    - POST
seo:
  description: >-
    Owner-only, write-only. Creates a new encrypted secret value under a name.
    The name… Reference for the POST /app/{id}/secrets endpoint in the Charming
    API API.
sidebar:
  badge: POST
  label: Create a new secret value
title: Create a new secret value
type: openapi-operation
---
Owner-only, write-only. Creates a new encrypted secret value under a 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. Returns 409 `secret_already_exists` if a secret with the same name already exists for this scope; use PUT to replace it. Requires the owner's user token; app/render tokens are rejected.

<Operation source="reference" id="create-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.
