> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Upsert or delete 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.



## OpenAPI

````yaml put /v1/secrets
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/secrets:
    put:
      tags:
        - secrets
      summary: Upsert or delete secrets
      description: >-
        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.
      operationId: upsertOrDeleteSecrets
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertOrDeleteSecretsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody_UpsertOrDeleteSecretsResult_'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: Unprocessable Entity
          content:
            text/plain:
              schema:
                type: string
        '507':
          description: Insufficient Storage
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    UpsertOrDeleteSecretsRequest:
      properties:
        secrets:
          items:
            $ref: '#/components/schemas/SecretKeyValue'
          type: array
          title: Secrets
      type: object
      required:
        - secrets
      title: UpsertOrDeleteSecretsRequest
      description: Request body for the PUT /secrets endpoint.
    ResponseBody_UpsertOrDeleteSecretsResult_:
      properties:
        data:
          $ref: '#/components/schemas/UpsertOrDeleteSecretsResult'
      type: object
      required:
        - data
      title: ResponseBody[UpsertOrDeleteSecretsResult]
    SecretKeyValue:
      properties:
        key:
          type: string
          title: Key
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
          description: >-
            Provide a string to create or update the secret, or explicit null to
            delete it. This field is required; omitting it returns 422.
      type: object
      required:
        - key
        - value
      title: SecretKeyValue
      description: A single secret entry specifying a key and a required nullable value.
    UpsertOrDeleteSecretsResult:
      properties:
        upserted_keys:
          items:
            type: string
          type: array
          title: Upserted Keys
        deleted_keys:
          items:
            type: string
          type: array
          title: Deleted Keys
      type: object
      required:
        - upserted_keys
        - deleted_keys
      title: UpsertOrDeleteSecretsResult
      description: Result payload listing which keys were upserted and which were deleted.

````