About this endpoint
What it does
Encrypts a text string using Fernet and returns the resulting ciphertext. If you do not provide a key, the service auto-generates one and includes it in the response.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| key | String | No | Base64-url Fernet key. Omit to auto-generate. |
| text | String | Yes | Text to encrypt. |
Response
Returns a JSON object with two string fields: key and ciphertext. The key field contains the Fernet key used for encryption, and ciphertext contains the encrypted output.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| key | String | No | Fernet key used for encryption. Present when the service generates or returns a key. |
| ciphertext | String | No | Encrypted text output. |