---
title: "Set secret"
method: POST
path: "/api/apps/{app_id}/secrets"
---

# Set secret

`POST /api/apps/{app_id}/secrets`

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Stores one or more secrets on the app and makes them available to its backend functions as environment variables. Send several at once by putting several keys in the body.

A name that already exists is overwritten, so this both creates and updates. Names must be uppercase letters, digits, and underscores, and must start with a letter, for example `STRIPE_SECRET_KEY`. Some names are reserved by Base44 and are rejected.

Setting a secret redeploys the app's backend functions so they pick up the new value.

<Warning>Secret values are write-only. Nothing in this API returns them once stored, so keep your own copy of anything you cannot regenerate.</Warning>

## Path parameters

- `app_id` string, required — ID of the app to set the secret on.

## Request body

- object — Each key is a secret name and each value is the secret itself.

## Response `200`

The secrets were stored.

- SetSecretsResponse
  - `success` boolean, required — Whether the secrets were stored.

## Other responses

- `400` — A secret name is not a valid environment variable name, or is reserved by Base44.
- `401` — Missing or invalid credentials.
- `403` — You don't have access to this app.
- `404` — App not found.
- `422` — Validation Error

---

[API](https://skmtc.dev/idealspot/apis/base44-app-management-api.md) · [All operations](https://skmtc.dev/idealspot/apis/base44-app-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/idealspot/base44-app-management-api/revisions/31ef75eb64ab/schema)
