Protect PDF with password
@CrossServiceSolutions
npx machina-cli add skill @CrossServiceSolutions/password-protect-pdf --openclawpassword-protect-pdf
Purpose
This skill password-protects a PDF by:
- accepting a PDF file from the user,
- accepting a password from the user,
- uploading both to the Solutions API,
- polling the job status until it is finished,
- returning the download URL for the password-protected PDF.
Credentials
The API requires an API key used as a Bearer token:
Authorization: Bearer <API_KEY>
How the user gets an API key:
- https://login.cross-service-solutions.com/register
- Or the user can provide an API key directly.
Rule: never echo or log the API key.
API endpoints
Base URL:
https://api.xss-cross-service-solutions.com/solutions/solutions
Create password-protect job:
POST /api/32multipart/form-dataparameters:file(PDF-Datei) — required — PDF fileuserPass(Passwort) — required — string password
Get result by ID:
GET /api/<ID>
When done, the response contains:
output.files[]with{ name, path }wherepathis a downloadable URL.
Inputs
Required
- PDF file (binary)
- Password (
userPass, string) - API key (string)
Optional
- None
Output
Return a structured result:
job_id(number)status(string)download_url(string, when done)file_name(string, when available)
Example output:
{
"job_id": 321,
"status": "done",
"download_url": "https://.../protected.pdf",
"file_name": "protected.pdf"
}
Overview
This skill accepts a PDF and a password, uploads both to the Solutions API, polls the job until completion, and returns a download URL for the encrypted PDF. It enables secure, shareable documents by automating PDF encryption and delivering a ready-to-use link.
How This Skill Works
Upload the PDF and userPass to POST /api/32 as multipart/form-data with a Bearer token. Poll GET /api/<ID> to monitor status until the job reports 'done', then return download_url (from output.files[].path) and file_name when available.
When to Use It
- Securely share a PDF with a password before sending externally
- Automate password protection in document workflows
- Standardize encryption across PDFs in a CMS or portal
- Deliver password-protected files to clients without sending the password in plaintext
- Integrate with other services to enforce consistent document security
Quick Start
- Step 1: Prepare your PDF and a password
- Step 2: POST /api/32 with multipart/form-data including file and userPass and your API key
- Step 3: Poll GET /api/<ID> until status is 'done' and return download_url and file_name
Best Practices
- Use a unique, strong password per file and avoid reusing passwords
- Never log or expose your API key
- Validate the input PDF and restrict allowed file types
- Handle polling timeouts and API errors gracefully
- Store and transfer the resulting download URL securely and only to authorized users
Example Use Cases
- Encrypt a 15MB contract.pdf with a strong password and return the download URL for client download
- Automatically password-protect reports before archiving and sharing via client portal
- Integrate into a document ingestion pipeline to secure every uploaded PDF
- Provide clients with a single, protected download link instead of emailing the file
- Operate across services to standardize PDF security with Solutions API