> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Update secret

> Replace the value of one of your organization's secrets.

Replaces the secret's value. The name can't be changed: to rename a secret, create a new one and delete the old one.

```bash theme={null}
curl -X PUT https://api.allium.so/api/v1/secrets/${SECRET_ID} \
  -H "X-API-KEY: ${ALLIUM_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{ "value": "n3w-s3cr3t-value" }'
```

Returns `200` with a `null` body on success, and `404` if the secret doesn't exist or belongs to another organization.


## OpenAPI

````yaml _openapi/account-api.json PUT /api/v1/secrets/{secret_id}
openapi: 3.1.0
info:
  title: Allium Account API
  version: 0.1.0
servers:
  - url: https://api.allium.so
security: []
paths:
  /api/v1/secrets/{secret_id}:
    put:
      tags:
        - SECRETS
      summary: Update Secret Value
      operationId: update_org_secret_value_api_v1_secrets__secret_id__put
      parameters:
        - $ref: '#/components/parameters/SecretId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgSecretValueRequest'
      responses:
        '200':
          description: Successful Response
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - APIKeyBearer: []
components:
  parameters:
    SecretId:
      name: secret_id
      in: path
      required: true
      description: Secret ID, as returned by Create Secret or List Secrets.
      schema:
        type: string
        title: Secret Id
  schemas:
    UpdateOrgSecretValueRequest:
      properties:
        value:
          type: string
          minLength: 1
          title: Value
          description: New secret value. Replaces the current value.
      type: object
      required:
        - value
      title: UpdateOrgSecretValueRequest
    ErrorMessage:
      properties:
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: ErrorMessage
  responses:
    NotFound:
      description: >-
        The secret does not exist in your organization, or the API key does not
        belong to an organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````