Functions

Create or update a secret

Changed on

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

Request

  • Base URL: https://api.primitive.dev/v1
  • URL: https://api.primitive.dev/v1/functions/{id}/secrets
  • Auth: HTTP bearer

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

successboolean required

Changes

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status