Skip to content
Dashboard
Theme
Theme

Add a secret to an organization-scoped key (shown once)

POST /v1/organizations/{org}/api_keys/{key}/secrets: Add a secret to an organization-scoped key (shown once).

View Markdown

POST /v1/organizations/{org}/api_keys/{key}/secrets

Up to 4 active extra secrets (api_key_secret_limit). The key’s scopes must be a subset of the calling key’s scopes.

Scope
api_keys:write
Auth
Secret key (sk_…)
Since
1.0
  • org string Required

  • key string Required

  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • Idempotency-Key string

    Honoured for 24 h; a replay returns the original response.

    min length 1 · max length 255

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/organizations/org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/api_keys/key_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/secrets" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY"
Response 201
{
"id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"object": "api_key_secret",
"prefix": "sk_test",
"secret": "sk_test_example"
}