Sites

Add a secret to a site

Changed on

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. Called by Crevio's agent, a script or an MCP client, value is null. 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
  • Auth
    API key in header Authorization

Path parameters

id, string required

The resource's ID, as returned in its id field

Headers

Idempotency-Key, string

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

object required
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)

Secret required
object, string required
id, string required
name, string required
target, string required
scope, string required
site_id, string nullable required
site_ids, string[] required
description, string nullable required
egress_host, string nullable required
egress_header, string nullable required
egress_placement, string required
egress_signing, object required
egress_default_headers, object required
last4, string required
value, string nullable required
created_at, string required

Changes

    • breaking

      the site_ids response's property type changed from object to array for status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    3 more changes in this revision