v2

latestOpenAPI 3.1.0Proprietary2026-07-26127193620.1 KB
Functions

Create or update a secret

Idempotent insert-or-update keyed on (function_id, key). Returns 201 the first time the key is set, 200 on subsequent updates. Values are encrypted at rest and only become visible to the running handler on the next deploy (PUT /functions/{id} with the existing code is sufficient to refresh bindings).

Keys must match ^[A-Z_][A-Z0-9_]*$ (uppercase letters, digits, underscores; first character is a letter or underscore). Values are at most 4096 UTF-8 bytes. System- managed keys are reserved and rejected.

post/functions/{id}/secrets

Headers

Idempotency-Keystring

Optional client-supplied idempotency key. Retrying a request with the same key returns the original result instead of performing the action a second time; if omitted the server derives one from the canonical payload hash. Safe to retry network failures without duplicating side effects.

Request body

keystring required

Uppercase letters, digits, and underscores. Must start with a letter or underscore. System-managed keys (e.g. PRIMITIVE_WEBHOOK_SECRET, PRIMITIVE_API_KEY, and PRIMITIVE_API_BASE_URL) are reserved.

valuestring required

Secret value, up to 4096 UTF-8 bytes. Encrypted at rest. Never returned by any read endpoint.

Response

Secret updated

successtrue required