---
title: "Update an existing secret"
method: PATCH
path: "/organizations/{org-slug}/secrets/{secret-name}"
tags: ["secrets"]
---

# Update an existing secret

`PATCH /organizations/{org-slug}/secrets/{secret-name}`

Update an existing secret. If the secret is protected, only its value can be overridden.

## Path parameters

- `org-slug` string, required
- `secret-name` string, required

## Request body

- object
  - `expand_in_step_inputs` boolean
  - `is_exposed_for_pull_requests` boolean
  - `is_protected` boolean
  - `value` string

## Response `200`

Ok

- object
  - `expand_in_step_inputs` boolean
  - `id` string
  - `is_exposed_for_pull_requests` boolean
  - `is_protected` boolean
  - `name` string
  - `scope` string
  - `value` string

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found

---

[API](https://skmtc.net/bitrise/apis/bitrise-api.md) · [All operations](https://skmtc.net/bitrise/apis/bitrise-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitrise/bitrise-api/versions/89468e4a014b/schema)
