---
title: "Upsert or delete secrets"
method: PUT
path: "/v1/secrets"
tags: ["secrets"]
---

# Upsert or delete secrets

`PUT /v1/secrets`

Atomically upsert or delete a batch of secrets. Entries with a non-null `value` are created or updated; entries with `value: null` are deleted. The `value` field is required for every entry, and omitting it returns 422. When the same key appears more than once, the last occurrence wins. Deleting a non-existent key succeeds silently. Secret values are never returned in the response.

## Request body

- UpsertOrDeleteSecretsRequest — Request body for the PUT /secrets endpoint.
  - `secrets` SecretKeyValue[], required
    - `key` string, required
    - `value` string, nullable, required — Provide a string to create or update the secret, or explicit null to delete it. This field is required; omitting it returns 422.

## Response `200`

Successful Response

- ResponseBodyUpsertOrDeleteSecretsResult
  - `data` UpsertOrDeleteSecretsResult, required — Result payload listing which keys were upserted and which were deleted.
    - `upserted_keys` string[], required
    - `deleted_keys` string[], required

## Other responses

- `403` — Forbidden
- `422` — Unprocessable Entity
- `507` — Insufficient Storage

---

[API](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api.md) · [All operations](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/arize-ai/arize-phoenix-rest-api/versions/5339b2afd3a2/schema)
