---
title: "Create Org Secret"
method: POST
path: "/organization/secrets"
tags: ["organization-secrets"]
---

# Create Org Secret

`POST /organization/secrets`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/organization/secrets`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Create an organization secret.

## Request body

- SecretCreate: Create a new secret. Secret types ------------ - `custom`: Arbitrary user-defined types - `token`: A token, e.g. API Key, JWT Token (TBC) - `oauth2`: OAuth2 Client Credentials (TBC) - `mtls`: TLS client certificate and key - `ca_cert`: Certificate authority bundle
  - `type` 'custom' | 'ssh_key' | 'mtls' | 'ca_cert' | 'github_app': The type of a secret.
  - `name` string, required
  - `description` string, nullable
  - `keys` SecretKeyValue[], required
    - `key` string, required
    - `value` string, password, required
  - `tags` object, nullable
  - `environment` string

## Response `201`

Successful Response

- SecretReadMinimal
  - `id` string, uuid, required
  - `type` 'custom' | 'ssh_key' | 'mtls' | 'ca_cert' | 'github_app', required: The type of a secret.
  - `name` string, required
  - `description` string, nullable
  - `keys` string[], required
  - `environment` string, required
  - `is_corrupted` boolean
  - `source` 'local' | 'aws_secrets_manager': Where a workspace secret's values live.
  - `store_id` string, uuid, nullable
  - `store_name` string, nullable
  - `remote_reference` string, nullable

## Other responses

- `422`: Validation Error

---

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