---
title: "Detach a Secret from a Function"
method: DELETE
path: "/v1/functions/{id}/secrets/{secretId}"
---

# Detach a Secret from a Function

`DELETE /v1/functions/{id}/secrets/{secretId}`

## Request

- Base URL: `https://api.browserbase.com`
- URL: `https://api.browserbase.com/v1/functions/{id}/secrets/{secretId}`
- Auth: API key in header `X-BB-API-Key`

Detach a secret from a Function, taking effect on the Function's next invocation. Note: Detaching a secret that is not attached succeeds to support idempotency.

## Path parameters

- `id` string, uuid, required
- `secretId` string, uuid, required

## Response `204`

The secret was detached from the function.

## Other responses

- `400`: Invalid request. The Function ID and secret ID must be UUIDs.
- `404`: The Function does not exist in the project. Detaching a secret that is not attached succeeds.

## Changes

- **2026-10-16** `266d5199a560`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/browserbase/apis/browserbase-api/changes/v1/functions/:id/secrets/:secretId/delete.md)

---

[API](https://skmtc.dev/browserbase/apis/browserbase-api.md) - [All operations](https://skmtc.dev/browserbase/apis/browserbase-api/llms.txt) - [OpenAPI document](https://skmtc.dev/browserbase/apis/browserbase-api/revisions/106c5f72c742?raw)
