---
search:
  tags:
    - Secrets
    - PUT
seo:
  description: >-
    The app must exist (404 otherwise). Bumps record_generation… Reference for
    the PUT /v1/apps/{project}/secrets/{name} endpoint in the Sproutboat Cloud
    API.
sidebar:
  label: Set one secret
  badge: PUT
title: Set one secret
type: openapi-operation
---
The app must exist (404 otherwise). Bumps `record_generation` even if the value is unchanged. A name the app does not declare as a `secret` binding is stored, with a `secret-not-declared` entry in `warnings` and the line that fixes it: the Worker's `env` is built from the declared bindings, so it does not see the value until a deploy declares the name (Wrangler needs no declaration; here it is a warning, not a refusal, so a secret may be set before the deploy that declares it).

`PUT /v1/apps/{project}/secrets/{name}`
