---
title: "Set Secrets"
method: PUT
path: "/v1/secrets"
tags: ["v1"]
---

# Set Secrets

`PUT /v1/secrets`

## Request

- Base URL: `https://api.ellipsis.dev`
- URL: `https://api.ellipsis.dev/v1/secrets`
- Auth: HTTP bearer

Upsert secrets.

Returns only the secrets this call wrote, names and timestamps
only — values are write-only. Refused for session tokens (held by
potentially-untrusted code running inside a session); mutations
require an API key or user token.

## Headers

- `user-agent` string, nullable

## Request body

- PutSecretsRequest: Store secrets for the account's session environments. Each secret is upserted by name: existing names are overwritten.
  - `secrets` SecretInput[], required: The secrets to store.
    - `name` string, required: The variable name. Must start with a letter or underscore and contain only letters, digits, and underscores.
    - `value` string, required: The variable value. Write-only: it is injected into session environments but never returned by the API.

## Response `200`

Successful Response

- SecretsListResponse: The account's environment variables, names and timestamps only — values are never returned.
  - `secrets` Secret[], required: The stored secrets.
    - `created_at` string, date-time, required: When the variable was created.
    - `name` string, required: The variable name.
    - `updated_at` string, date-time, required: When the variable's value was last updated.

## Other responses

- `400`: A variable name is invalid, or the batch would exceed the per-account variable limit.
- `401`: The bearer token is missing, invalid, or revoked.
- `403`: The credential may not perform this action, or the account is blocked.
- `422`: Validation Error

---

[API](https://skmtc.dev/ellipsis/apis/ellipsis-rest-api.md) - [All operations](https://skmtc.dev/ellipsis/apis/ellipsis-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ellipsis/apis/ellipsis-rest-api/revisions/344b16df9a1a?raw)
