---
title: "Choose Always, Ask or Never for the caller's own use of a secret"
method: PUT
path: "/v1/org/my-secrets/{secretId}/rule"
tags: ["Secrets"]
---

# Choose Always, Ask or Never for the caller's own use of a secret

`PUT /v1/org/my-secrets/{secretId}/rule`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/org/my-secrets/{secretId}/rule`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Sets the calling member's own rule on a secret they are allowed to use: allow (always), ask, block (never), or default to clear it. Choosing allow needs a recent sign-in and is refused when the organization asks every time.

## Path parameters

- `secretId` string, required

## Request body

- SetMyOrganizationSecretRuleRequest
  - `rule` 'allow' | 'ask' | 'block' | 'default', required

## Response `200`

The secret with the caller's updated rule.

- MyOrganizationSecret
  - `secret` UsableOrganizationSecret, required
    - `id` string, required
    - `name` string, required
    - `description` string, nullable, required
    - `secretType` 'mcp_header' | 'http_header' | 'ssh_key' | 'cli_env' | 'web_login', required
    - `executionBoundary` 'cloud_only' | 'desktop_allowed', required
    - `targetHost` string, nullable, required
    - `targetCommand` string, nullable, required
    - `headerName` string, nullable, required
    - `envName` string, nullable, required
    - `loginUsername` string, nullable, required
  - `access` object, required
    - `effectiveRule` 'allow' | 'ask' | 'block', required
    - `myRule` 'allow' | 'ask' | 'block', nullable, required
    - `organizationRule` 'allow' | 'ask' | 'block', nullable, required
    - `canChooseAlways` boolean, required
  - `lastUsedAt` string, date-time, nullable, required

## Other responses

- `400`: Invalid request.
- `401`: Sign-in required.
- `403`: Not allowed, approval required, wrong target, or a person's own sign-in is required.
- `404`: Organization secrets are off or the secret is not available to the caller.
- `409`: The organization decides this rule.

## Changes

- **2026-12-03** `b433928052b7`: 1 info
  - added the required property `secret/headerName` to the response with the `200` status
- **2026-12-03** `6a95d77df4da`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/my-secrets/:secretId/rule/put.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
