Sites

Add a secret to a site

Encrypts and stores a new secret on this site, then injects it into the live site as an environment variable (asynchronously, if the site is deployed). The decrypted value is returned only in this response — store it if you need it, as later list responses expose just last4. Names must be valid environment-variable identifiers and may not use the reserved CREVIO_ prefix.

post/sites/{id}/secrets

Request

  • Base URL: https://api.crevio.co/v1
  • URL: https://api.crevio.co/v1/sites/{id}/secrets
  • Auth: API key in header Authorization

Path parameters

idstring required

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

Headers

Idempotency-Keystring

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

namestring 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.

valuestring required

The secret value to encrypt and inject.

descriptionstring

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

Response

Secret created (includes the decrypted value)

objectstring required
idstring required
namestring required
targetstring required
scopestring required
site_idstring nullable required
site_idsobject required
descriptionstring nullable required
egress_hoststring nullable required
egress_headerstring nullable required
egress_placementstring required
egress_signingobject required
egress_default_headersobject required
last4string required
valuestring nullable required
created_atstring required

Changes

No recorded changes to this operation across all 2 revisions of this API.