C
CIFP

Secrets API

Manage proxy secrets via the REST API.

Secrets are encrypted key-value pairs stored in the proxy's runtime store. Secret values are never returned by any endpoint.

List Secrets

GET/api/proxies/:id/secrets
bash
curl https://cifp.vril.dev/api/proxies/proxy-id/secrets \
  -H "Authorization: Bearer cifp_your_api_key"
Response
{
  "secrets": [
    {
      "id":          "secret_abc123",
      "name":        "OPENAI_API_KEY",
      "description": "OpenAI production key",
      "expiresAt":   null,
      "createdAt":   "2026-06-01T10:00:00Z",
      "updatedAt":   "2026-06-01T10:00:00Z"
    }
  ],
  "count": 1
}

Create / Update Secret

POST/api/proxies/:id/secrets

If a secret with the same name already exists, its value is replaced (upsert behaviour).

bash
curl -X POST https://cifp.vril.dev/api/proxies/proxy-id/secrets \
  -H "Authorization: Bearer cifp_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name":        "OPENAI_API_KEY",
    "value":       "sk-proj-your-real-key",
    "description": "OpenAI production key",
    "expiresAt":   "2026-12-31T00:00:00Z"
  }'
FieldRequiredDescription
nameYesUPPER_SNAKE_CASE name. Max 255 chars.
valueYesThe secret value. Encrypted at rest. Never returned.
descriptionNoHuman-readable note. Max 500 chars.
expiresAtNoISO-8601 datetime. Secret is treated as absent after this.

Delete Secret

DELETE/api/proxies/:id/secrets/:secretId

Deletes the secret from the database and the proxy's runtime store. Any subsequent request using the $THAT_NAME placeholder will pass through unresolved.

bash
curl -X DELETE \
  https://cifp.vril.dev/api/proxies/proxy-id/secrets/secret-id \
  -H "Authorization: Bearer cifp_your_api_key"

# Returns 204 No Content