Skip to main content
POST
/
sites
/
{id}
/
secrets
Typescript (SDK)
import { Crevio } from "@crevio/sdk";

const crevio = new Crevio({
  apiKey: process.env["CREVIO_API_KEY"] ?? "",
});

async function run() {
  const result = await crevio.sites.createSecret({
    id: "<id>",
    requestBody: {
      name: "STRIPE_SECRET_KEY",
      value: "<value>",
    },
  });

  console.log(result);
}

run();
{
  "object": "<string>",
  "id": "<string>",
  "name": "<string>",
  "target": "<string>",
  "description": "<string>",
  "last4": "<string>",
  "value": "<string>",
  "created_at": "<string>"
}

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Path Parameters

id
string
required

The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")

Body

application/json
name
string
required

Environment-variable name (e.g. STRIPE_SECRET_KEY). Uppercase letters, digits, and underscores; cannot start with a digit or use the reserved CREVIO_ prefix.

value
string
required

The secret value to encrypt and inject.

description
string

Optional human-readable note about what this secret is for.

Response

Secret created (includes the decrypted value)

object
string
required
id
string
required
name
string
required
target
string
required
description
string | null
required
last4
string
required
value
string | null
required
created_at
string
required