---
title: "Rotate a workflow secret"
method: PUT
path: "/workflows/{workflowId}/secrets/{key}"
tags: ["Secrets"]
---

# Rotate a workflow secret

`PUT /workflows/{workflowId}/secrets/{key}`

## Request

- Base URL: `https://workflow.loopfour.ai/api/v1`
- URL: `https://workflow.loopfour.ai/api/v1/workflows/{workflowId}/secrets/{key}`
- Auth: API key in header `x-api-key`

Updates (rotates) the value of an existing secret without revealing the previous one.

## Path parameters

- `workflowId` string, required
- `key` string, required

## Request body

- object
  - `value` string, required

## Response `200`

Success

- object
  - `success` unknown
  - `data` Secret
    - `id` string
    - `workflowId` string
    - `key` string
    - `maskedValue` string, nullable
    - `lastUsedAt` string, date-time, nullable
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Bad request — invalid parameters or request body.
- `401`: Missing or invalid API key.
- `403`: Forbidden — insufficient permissions for this resource.
- `404`: Resource not found.

---

[API](https://skmtc.dev/loopfour/apis/loopfour-workflows-api.md) - [All operations](https://skmtc.dev/loopfour/apis/loopfour-workflows-api/llms.txt) - [OpenAPI document](https://skmtc.dev/loopfour/apis/loopfour-workflows-api/revisions/872822a3af00?raw)
