---
title: "Setup or reconfigure secrets provider"
method: POST
path: "/api/v1beta/secrets"
tags: ["secrets"]
---

# Setup or reconfigure secrets provider

`POST /api/v1beta/secrets`

Setup the secrets provider with the specified type and configuration.

## Request body

- union
  - object
  - PkgApiV1SetupSecretsRequest — Request to setup a secrets provider
    - `password` string — Password for encrypted provider (optional, can be set via environment variable) TODO Review environment variable for this
    - `provider_type` string — Type of the secrets provider (encrypted, 1password, environment)

## Response `201`

Created

- PkgApiV1SetupSecretsResponse — Response after initializing a secrets provider
  - `message` string — Success message
  - `provider_type` string — Type of the secrets provider that was setup

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

## Changes

> 49 revisions in range; 5 could not be searched.

- **2026-03-17** `8ab2f5690c97` — 1 breaking, 1 info
  - removed `#/components/schemas/v1.setupSecretsRequest` from the request body `oneOf` list
  - added `#/components/schemas/pkg_api_v1.setupSecretsRequest` to the request body `oneOf` list
- **2026-01-29** `ff6ce8dd8f3a` — 1 breaking, 1 info
  - removed `#/components/schemas/pkg_api_v1.setupSecretsRequest` from the request body `oneOf` list
  - added `#/components/schemas/v1.setupSecretsRequest` to the request body `oneOf` list

[Change history](https://skmtc.dev/stacklok/apis/toolhive-api/changes/api/v1beta/secrets/post.md)

---

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