---
title: "Create a Secret."
method: POST
path: "/v1/secrets"
tags: ["secrets"]
---

# Create a Secret.

`POST /v1/secrets`

Create a new Secret with a globally unique name and value. The Secret will be encrypted at rest and made available as an environment variable in Devboxes.

## Request body

- SecretCreateParameters — Parameters required to create a new Secret.
  - `name` string, required — The globally unique name for the Secret. Must be a valid environment variable name (alphanumeric and underscores only). Example: 'DATABASE_PASSWORD'
  - `value` string, required — The value to store for this Secret. This will be encrypted at rest and made available as an environment variable in Devboxes. Example: 'my-secure-password'

## Response `200`

Secret created successfully. Returns the Secret with its value included.

- SecretView — A Secret represents a key-value pair that can be securely stored and used in Devboxes as environment variables.
  - `id` string, required — The unique identifier of the Secret.
  - `name` string, required — The globally unique name of the Secret. Used as the environment variable name in Devboxes.
  - `create_time_ms` integer, required — Creation time of the Secret (Unix timestamp in milliseconds).
  - `update_time_ms` integer, required — Last update time of the Secret (Unix timestamp in milliseconds).

## Other responses

- `400` — Bad request. Secret name already exists, is invalid, or contains illegal characters.
- `401` — Unauthorized. Invalid or missing authentication.
- `403` — Forbidden. Account does not have devbox capability.
- `500` — Internal server error.

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/e9dc776053e4/schema)
