Skip to Content
Secrets

Create a write-only secret

Permissionsecrets:createRetriesIdempotency-Key requiredAuthentication
POST
/secrets

Encrypts the supplied value under the workspace data key. The value is accepted exactly once and is never returned; use PATCH to rotate it.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
name*SecretName

Stable name of an active workspace secret. The referenced plaintext is never returned through the API.

Match^[A-Za-z_][A-Za-z0-9_]{1,63}$
Length2 <= length <= 64
description?|

Optional operator note. Whitespace-only values normalize to null.

Lengthlength <= 2000
value*string

Write-only UTF-8 value, at most 16384 encoded bytes. It is encrypted before storage and never echoed.

Length1 <= length

Response Body

Secret created. Only safe metadata is returned.

application/json
  1. response

Safe write-only secret metadata. No plaintext, ciphertext, data-key ID, or wrapped key is ever included.

id*string
Formatuuid
name*SecretName

Stable name of an active workspace secret. The referenced plaintext is never returned through the API.

Match^[A-Za-z_][A-Za-z0-9_]{1,63}$
Length2 <= length <= 64
description*string|null
fingerprint_suffix*|

Up to the final four characters of the submitted value, for operator identification only.

Lengthlength <= 4
last_used_at*|
Formatdate-time
archived_at*|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.kejue.co/v1/secrets' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "value": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "fingerprint_suffix": "stri",  "last_used_at": "2019-08-24T14:15:22Z",  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}