---
title: "Delete a secret by it's Id"
method: DELETE
path: "/secrets/{secretId}"
tags: ["secrets"]
---

# Delete a secret by it's Id

`DELETE /secrets/{secretId}`

Deletes a specific Secret from the Environment or Space as is the case

## Path parameters

- `secretId` string, required — Secret ID

## Headers

- `Authorization` string, required
- `X-Disable-Hooks` 'true', required

## Response `200`

Response with status 200

- TypeSecretsSecretsResponse
  - `data` TypeSecretsSecret[], required
    - `name` string, required — The name of a secret. Minimum 1 character, maximum 1024
    - `value` string, required — The value of a secret. Minimum 1 character, maximum 1024
    - `environmentId` string — Environment ID
    - `spaceId` string — Space ID
    - `actorId` union
      - string — User ID
      - string — Agent ID
      - string — Guest ID
    - `id` string, required — Secret ID

## Other responses

- `400` — Error response with status 400
- `404` — Error response with status 404

---

[API](https://skmtc.net/flatfile/apis/api-reference.md) · [All operations](https://skmtc.net/flatfile/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flatfile/api-reference/revisions/9d3a9979cd96/schema)
