Create Secret
Create a new secret in organization vault.
Security:
- Secret value is encrypted at rest using Fernet encryption
- Encrypted using ENCRYPTION_KEY from environment
- Decrypted value is NEVER returned in API responses
- Only secret names are exposed in list operations
Use Cases:
- Store API keys for external services (Stripe, GitHub, etc.)
- Store authentication tokens for api_call retriever stage
- Store credentials for third-party integrations
Important:
- Secret names must be unique within organization
- Use update endpoint to modify existing secrets
- Delete and recreate if you forget the value
Headers
Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.
"Bearer YOUR_MIXPEEK_API_KEY"
Body
Request to create a new secret in the organization vault.
Secrets are encrypted at rest using Fernet encryption and stored in the organization document. Use secrets to securely store API keys, tokens, and credentials for external services.
Use Cases:
- Store API keys for Stripe, GitHub, OpenAI, etc.
- Manage authentication tokens for api_call retriever stage
- Store credentials for third-party integrations
Security:
- Secret values are encrypted using ENCRYPTION_KEY from environment
- Decrypted values are NEVER returned in API responses
- Only secret names are exposed in list operations
- Access is logged for audit trail
Requirements:
- secret_name: REQUIRED, must be unique within organization
- secret_value: REQUIRED, plaintext value to encrypt
Permissions: Requires ADMIN permission to create secrets.
REQUIRED. Name/key for the secret. Use descriptive names that indicate the service and purpose. Must be unique within the organization. Format: lowercase with underscores (e.g., 'stripe_api_key'). Common patterns: '{service}{type}{environment}' like 'stripe_api_key_prod'. This name is used to reference the secret in api_call stage configuration. Examples: 'stripe_api_key', 'github_token', 'openai_api_key', 'weather_api_key'.
1 - 100"stripe_api_key"
"github_token"
"openai_api_key"
"weather_api_key"
REQUIRED. Plaintext secret value to encrypt and store. This value will be encrypted at rest using Fernet encryption. The encrypted value is stored in MongoDB with the organization document. The plaintext value is NEVER logged or exposed in API responses. Only the secret name is visible when listing secrets. Use this field to store: API keys, tokens, passwords, credentials. Format: any string (will be encrypted as-is). For Basic auth, use format 'username:password'.
1"sk_test_abc123..."
"ghp_abc123..."
"abc123def456"
Response
Successful Response
Response for secret operations (NEVER includes actual decrypted value).
This response is returned after creating, updating, or deleting a secret. For security, the actual secret value is NEVER included in API responses. Only the secret name and operation status are returned.
Security:
- Decrypted secret values are NEVER included
- Only secret name and operation status returned
- Actual value only accessible by internal services
Fields:
- secret_name: Name of the secret that was operated on
- created: True if secret was created (null for other operations)
- updated: True if secret was updated (null for other operations)
- deleted: True if secret was deleted (null for other operations)
Name of the secret that was operated on. This is the same name provided in the request. Use this name to reference the secret in api_call stage configuration.
"stripe_api_key"
"github_token"
"openai_api_key"
True if this secret was created, null otherwise. Only set for POST /secrets operations.
True if this secret was updated, null otherwise. Only set for PUT /secrets/{name} operations.
True if this secret was deleted, null otherwise. Only set for DELETE /secrets/{name} operations.

