---
title: "Store a write-only organization secret"
method: POST
path: "/v1/org/secrets"
tags: ["Secrets"]
---

# Store a write-only organization secret

`POST /v1/org/secrets`

## Request

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

Stores an organization secret encrypted with a per-secret envelope key and AES-GCM AAD binding its type, exact target, and execution boundary. Refuses agent and API-key callers.

## Request body

- CreateOrganizationSecretRequest
  - `name` string, required
  - `description` string, nullable
  - `secretType` 'mcp_header' | 'http_header' | 'ssh_key' | 'cli_env' | 'web_login', required
  - `executionBoundary` 'cloud_only' | 'desktop_allowed'
  - `targetHost` string
  - `targetCommand` string
  - `headerName` string
  - `headerPrefix` string
  - `envName` string
  - `loginUsername` string
  - `secretValue` string, required
  - `allowBlindUse` OrganizationSecretBlindUseRequest
    - `everyone` boolean
    - `teamIds` string[]
    - `memberIds` string[]
    - `agentIds` string[]
  - `defaultRule` 'allow' | 'ask' | 'block'

## Response `201`

Created secret metadata.

- OrganizationSecretDetailResponse
  - `secret` OrganizationSecretSummary, 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
    - `headerPrefix` string, nullable, required
    - `envName` string, nullable, required
    - `loginUsername` string, nullable, required
    - `keyProvider` string, required
    - `secretVersion` integer, required
    - `lastUsedAt` string, date-time, nullable, required
    - `blindUseSummary` object, required
      - `everyone` boolean, required
      - `teams` integer, required
      - `members` integer, required
      - `agents` integer, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
  - `blindUse` object, required
    - `everyone` boolean, required
    - `teams` OrganizationSecretBlindUseTeam[], required
      - `teamId` string, required
      - `name` string, required
      - `members` integer, required
      - `grantedAt` string, date-time, required
      - `grantedByMemberId` string, required
    - `principals` OrganizationSecretBlindUsePrincipal[], required
      - `memberId` string, required
      - `kind` 'member' | 'agent', required
      - `name` string, nullable, required
      - `email` string, nullable, required
      - `agentId` string, nullable, required
      - `grantedAt` string, date-time, required
      - `grantedByMemberId` string, required
  - `rules` OrganizationSecretRule[], required
    - `id` string, required
    - `subjectKind` 'organization' | 'team' | 'member' | 'agent', required
    - `subjectId` string, required
    - `rule` 'allow' | 'ask' | 'block', required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Invalid request or machine caller attempted to write a secret.
- `401`: Sign-in required.
- `403`: Missing permission, recent sign-in, or blind-use authorization.
- `404`: Organization secrets are off or resource not found.
- `409`: A secret with this name already exists.

## Changes

- **2026-12-03** `b433928052b7`: 4 breaking, 1 warning
  - removed the required property `secret/sshFingerprint` from the response with the `201` status
  - removed the required property `secret/sshPublicKey` from the response with the `201` status
  - removed the required property `secret/targetConnectionId` from the response with the `201` status
  - removed the required property `secret/targetConnectionName` from the response with the `201` status
  - …1 more
- **2026-12-03** `6a95d77df4da`: 1 warning, 4 info
  - added the new `web_login` enum value to the `secret/secretType` response property for the response status `201`
  - added the new optional request property `loginUsername`
  - added the new `web_login` enum value to the request property `secretType`
  - added the required property `secret/lastUsedAt` to the response with the `201` status
  - …1 more
- **2026-12-02** `1c1cd9580c18`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/secrets/post.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)
