`POST /api/v1/secrets` — create a new secret.
POST
/api/v1/secrets
const url = 'https://example.com/api/v1/secrets';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"description":"example","expires_at":"example","name":"example","restriction":{"node_ids":["example"],"tags":"example"},"value":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/secrets \ --header 'Content-Type: application/json' \ --data '{ "description": "example", "expires_at": "example", "name": "example", "restriction": { "node_ids": [ "example" ], "tags": "example" }, "value": "example" }'Request Body required
Section titled “Request Body required ” Media type application/json
Request body for POST /api/v1/secrets.
object
description
Human-readable description.
string | null
expires_at
Optional expiry date (RFC 3339 timestamp).
string | null
name
required
Secret name.
string
restriction
value
required
Secret value (plaintext).
string
Example generated
{ "description": "example", "expires_at": "example", "name": "example", "restriction": { "node_ids": [ "example" ], "tags": "example" }, "value": "example"}Responses
Section titled “ Responses ”Secret created
Media type application/json
Response body for a single secret (never includes value).
object
created_at
required
string
created_by
required
string
description
string | null
expires_at
string | null
name
required
string
restriction
updated_at
required
string
updated_by
required
string
Example generated
{ "created_at": "example", "created_by": "example", "description": "example", "expires_at": "example", "name": "example", "restriction": "example", "updated_at": "example", "updated_by": "example"}Invalid request body or restriction
Secret already exists