/v1/encrypt-file

Encrypt files using password-based encryption.

Tool Usage Notes

Accepts one or multiple file URLs.
Password is required on each request.
Encrypted output extension is .fmenc.
If one file is encrypted, you get a single .fmenc file; multiple files return ZIP.

Estimate Before Processing

Use the estimate endpoint to preview token cost and validate your input URLs before starting conversion.

curl -X POST https://filemazing.com/v1/encrypt-file/estimate \
  -H "Authorization: Bearer fm_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": ["https://example.com/file"],
    "response_type": "json"
  }'
{
  "ok": true,
  "tool": "encrypt-file",
  "mode": "estimate",
  "estimated_tokens": 1,
  "available_tokens": 10,
  "enough_tokens": true,
  "shortfall_tokens": 0
}

Example Request

Provide algorithm and password in the payload.

curl -X POST https://filemazing.com/api/v1/encrypt-file \
  -H "Authorization: Bearer fm_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": ["https://example.com/document.pdf"],
    "algorithm": "aes256",
    "password": "your-password",
    "response_type": "json"
  }'

Request Parameters Breakdown

Parameter Required Type Options Default Example
inputs Yes array<string> HTTP/HTTPS URL(s) to files none (required) ["https://example.com/document.pdf"]
Provide one or more file URLs.
algorithm Yes string aes256, chacha20, aes128 none (required) aes256
Encryption algorithm to apply.
password Yes string Any non-empty string none (required) your-password
Required to encrypt and later decrypt output files.
response_type No string json, xml, text json json
Controls API response payload format.
promo_code No string Any active promo code empty SPRING25
Optional; applies discount rules when valid.

Example Response

Encrypted file is returned via download URL.

{
  "ok": true,
  "tool": "encrypt-file",
  "mode": "sync",
  "status": "completed",
  "download_url": "https://filemazing.com/tool/encrypt-file/jobs/.../download",
  "estimated_tokens": 1,
  "final_tokens": 1
}

Response Fields Breakdown

Field Type Always Returned Example
ok boolean Yes true
Indicates success/failure.
tool string Yes encrypt-file
Tool identifier.
mode string Yes sync
Current execution mode.
status string Yes completed
Processing state.
download_url string Yes https://filemazing.com/tool/encrypt-file/jobs/.../download
Single .fmenc file or ZIP download URL.
estimated_tokens integer Yes 1
Estimated reserved tokens.
final_tokens integer Yes 1
Final charged tokens.