curl --request POST \
--url https://api.autype.com/api/v1/dev/tools/pdf/protect \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"userPassword": "my-secret",
"ownerPassword": "owner-secret",
"webhook": {
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"headerName": "X-API-Key",
"headerValue": "my-secret-key",
"basicAuthUsername": "user",
"basicAuthPassword": "pass"
}
}
}
'import requests
url = "https://api.autype.com/api/v1/dev/tools/pdf/protect"
payload = {
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"userPassword": "my-secret",
"ownerPassword": "owner-secret",
"webhook": {
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"headerName": "X-API-Key",
"headerValue": "my-secret-key",
"basicAuthUsername": "user",
"basicAuthPassword": "pass"
}
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileId: '550e8400-e29b-41d4-a716-446655440000',
userPassword: 'my-secret',
ownerPassword: 'owner-secret',
webhook: {
webhookUrl: 'https://example.com/webhook',
webhookAuth: {
headerName: 'X-API-Key',
headerValue: 'my-secret-key',
basicAuthUsername: 'user',
basicAuthPassword: 'pass'
}
}
})
};
fetch('https://api.autype.com/api/v1/dev/tools/pdf/protect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autype.com/api/v1/dev/tools/pdf/protect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileId' => '550e8400-e29b-41d4-a716-446655440000',
'userPassword' => 'my-secret',
'ownerPassword' => 'owner-secret',
'webhook' => [
'webhookUrl' => 'https://example.com/webhook',
'webhookAuth' => [
'headerName' => 'X-API-Key',
'headerValue' => 'my-secret-key',
'basicAuthUsername' => 'user',
'basicAuthPassword' => 'pass'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.autype.com/api/v1/dev/tools/pdf/protect"
payload := strings.NewReader("{\n \"fileId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"userPassword\": \"my-secret\",\n \"ownerPassword\": \"owner-secret\",\n \"webhook\": {\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"headerName\": \"X-API-Key\",\n \"headerValue\": \"my-secret-key\",\n \"basicAuthUsername\": \"user\",\n \"basicAuthPassword\": \"pass\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.autype.com/api/v1/dev/tools/pdf/protect")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"userPassword\": \"my-secret\",\n \"ownerPassword\": \"owner-secret\",\n \"webhook\": {\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"headerName\": \"X-API-Key\",\n \"headerValue\": \"my-secret-key\",\n \"basicAuthUsername\": \"user\",\n \"basicAuthPassword\": \"pass\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autype.com/api/v1/dev/tools/pdf/protect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"userPassword\": \"my-secret\",\n \"ownerPassword\": \"owner-secret\",\n \"webhook\": {\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"headerName\": \"X-API-Key\",\n \"headerValue\": \"my-secret-key\",\n \"basicAuthUsername\": \"user\",\n \"basicAuthPassword\": \"pass\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"action": "pdf.merge",
"status": "PENDING",
"inputFileIds": [
"file-id-1"
],
"outputFileId": null,
"error": null,
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": {},
"completedAt": {},
"result": {},
"metadata": {}
}Protect PDF
Encrypt a PDF with password protection. Provide a user password (to open) and/or an owner password (to edit). At least one is required.
curl --request POST \
--url https://api.autype.com/api/v1/dev/tools/pdf/protect \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"userPassword": "my-secret",
"ownerPassword": "owner-secret",
"webhook": {
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"headerName": "X-API-Key",
"headerValue": "my-secret-key",
"basicAuthUsername": "user",
"basicAuthPassword": "pass"
}
}
}
'import requests
url = "https://api.autype.com/api/v1/dev/tools/pdf/protect"
payload = {
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"userPassword": "my-secret",
"ownerPassword": "owner-secret",
"webhook": {
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"headerName": "X-API-Key",
"headerValue": "my-secret-key",
"basicAuthUsername": "user",
"basicAuthPassword": "pass"
}
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileId: '550e8400-e29b-41d4-a716-446655440000',
userPassword: 'my-secret',
ownerPassword: 'owner-secret',
webhook: {
webhookUrl: 'https://example.com/webhook',
webhookAuth: {
headerName: 'X-API-Key',
headerValue: 'my-secret-key',
basicAuthUsername: 'user',
basicAuthPassword: 'pass'
}
}
})
};
fetch('https://api.autype.com/api/v1/dev/tools/pdf/protect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autype.com/api/v1/dev/tools/pdf/protect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileId' => '550e8400-e29b-41d4-a716-446655440000',
'userPassword' => 'my-secret',
'ownerPassword' => 'owner-secret',
'webhook' => [
'webhookUrl' => 'https://example.com/webhook',
'webhookAuth' => [
'headerName' => 'X-API-Key',
'headerValue' => 'my-secret-key',
'basicAuthUsername' => 'user',
'basicAuthPassword' => 'pass'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.autype.com/api/v1/dev/tools/pdf/protect"
payload := strings.NewReader("{\n \"fileId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"userPassword\": \"my-secret\",\n \"ownerPassword\": \"owner-secret\",\n \"webhook\": {\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"headerName\": \"X-API-Key\",\n \"headerValue\": \"my-secret-key\",\n \"basicAuthUsername\": \"user\",\n \"basicAuthPassword\": \"pass\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.autype.com/api/v1/dev/tools/pdf/protect")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"userPassword\": \"my-secret\",\n \"ownerPassword\": \"owner-secret\",\n \"webhook\": {\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"headerName\": \"X-API-Key\",\n \"headerValue\": \"my-secret-key\",\n \"basicAuthUsername\": \"user\",\n \"basicAuthPassword\": \"pass\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autype.com/api/v1/dev/tools/pdf/protect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"userPassword\": \"my-secret\",\n \"ownerPassword\": \"owner-secret\",\n \"webhook\": {\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"headerName\": \"X-API-Key\",\n \"headerValue\": \"my-secret-key\",\n \"basicAuthUsername\": \"user\",\n \"basicAuthPassword\": \"pass\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"action": "pdf.merge",
"status": "PENDING",
"inputFileIds": [
"file-id-1"
],
"outputFileId": null,
"error": null,
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": {},
"completedAt": {},
"result": {},
"metadata": {}
}Authorizations
API Key (starts with ak_...)
Body
File ID of the PDF to protect
"550e8400-e29b-41d4-a716-446655440000"
User password (required to open the PDF). At least one of userPassword or ownerPassword is required.
"my-secret"
Owner password (required to change permissions). At least one of userPassword or ownerPassword is required.
"owner-secret"
Optional webhook configuration
Show child attributes
Show child attributes
Response
Protect job created
Job ID
"550e8400-e29b-41d4-a716-446655440000"
Action that was performed
"pdf.merge"
Current job status
PENDING, PROCESSING, COMPLETED, FAILED "PENDING"
Input file IDs used for this job
["file-id-1"]
Output file ID (available when COMPLETED)
null
Error message (available when FAILED)
null
Job creation timestamp
Job start timestamp
Job completion timestamp
Structured job result data (e.g. OCR markdown/JSON, generated filename, PDF metadata, form fields). Available when the job produces a direct result instead of an output file.
Deprecated — use result instead. Additional metadata, duplicated from result for backward compatibility.
