Go to Page

Remove the signatures from a PDF

Strip the cryptographic signatures and timestamps from a PDF so it can be merged, stamped, or re-paginated cleanly. Page content is left intact.

Remove the cryptographic signatures and timestamps from a PDF document. A digital signature seals a document and certifies who signed it and that nothing has changed since, so any further edit, such as merging, stamping, or re-paginating, would break that seal and invalidate the signature. Stripping the signatures and timestamps first lets you re-process a signed document cleanly; the page content is left intact. The API is stateless: your document is processed in-region and never stored.

Endpoint

POST
/v1/remove_signatures

Available in every region. See Regions & data residency for routing and data residency.

Region URL
Global https://api.pdfblocks.com/v1/remove_signatures
United States https://us.api.pdfblocks.com/v1/remove_signatures
US HIPAA https://hipaa.api.pdfblocks.com/v1/remove_signatures
European Union https://eu.api.pdfblocks.com/v1/remove_signatures
United Kingdom https://uk.api.pdfblocks.com/v1/remove_signatures
Canada https://ca.api.pdfblocks.com/v1/remove_signatures
Australia https://au.api.pdfblocks.com/v1/remove_signatures
Japan https://jp.api.pdfblocks.com/v1/remove_signatures
India https://in.api.pdfblocks.com/v1/remove_signatures
Brazil https://br.api.pdfblocks.com/v1/remove_signatures

Authentication

Authenticate every request with your secret API key in the X-API-Key header, over HTTPS. Create and manage keys from the dashboard. See Authentication for details.

Request

The endpoint accepts a multipart/form-data request body.

filefilerequired

The input PDF document.

Examples

Strip the signatures and timestamps from a signed PDF:

cURLbash
curl https://api.pdfblocks.com/v1/remove_signatures \
  -H 'X-API-Key: your_api_key' \
  -F file=@input.pdf \
  -o unsigned.pdf
Pythonpython
# pip install requests
import requests

with open('input.pdf', 'rb') as file:
    response = requests.post(
        'https://api.pdfblocks.com/v1/remove_signatures',
        headers={'X-API-Key': 'your_api_key'},
        files={'file': file},
    )

response.raise_for_status()
with open('unsigned.pdf', 'wb') as output:
    output.write(response.content)
Node.jsjavascript
// Node.js 18+
import { readFile, writeFile } from 'node:fs/promises';

const body = new FormData();
body.set('file', new Blob([await readFile('input.pdf')]), 'input.pdf');

const response = await fetch('https://api.pdfblocks.com/v1/remove_signatures', {
  method: 'POST',
  headers: { 'X-API-Key': 'your_api_key' },
  body,
});

if (!response.ok) throw new Error(`Request failed: ${response.status}`);
await writeFile('unsigned.pdf', Buffer.from(await response.arrayBuffer()));
PHPphp
<?php
$ch = curl_init('https://api.pdfblocks.com/v1/remove_signatures');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['X-API-Key: your_api_key'],
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => [
        'file' => new CURLFile('input.pdf', 'application/pdf'),
    ],
]);

$pdf = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) {
    file_put_contents('unsigned.pdf', $pdf);
}
Rubyruby
# gem install http
require 'http'

response = HTTP
  .headers('X-API-Key' => 'your_api_key')
  .post('https://api.pdfblocks.com/v1/remove_signatures', form: {
    file: HTTP::FormData::File.new('input.pdf'),
  })

File.write('unsigned.pdf', response.body) if response.status.success?
Gogo
package main

import (
	"bytes"
	"io"
	"mime/multipart"
	"net/http"
	"os"
)

func main() {
	var buf bytes.Buffer
	form := multipart.NewWriter(&buf)

	file, _ := os.Open("input.pdf")
	defer file.Close()
	part, _ := form.CreateFormFile("file", "input.pdf")
	io.Copy(part, file)
	form.Close()

	req, _ := http.NewRequest("POST", "https://api.pdfblocks.com/v1/remove_signatures", &buf)
	req.Header.Set("Content-Type", form.FormDataContentType())
	req.Header.Set("X-API-Key", "your_api_key")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	out, _ := os.Create("unsigned.pdf")
	defer out.Close()
	io.Copy(out, res.Body)
}
C#csharp
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "your_api_key");

using var form = new MultipartFormDataContent
{
    { new ByteArrayContent(File.ReadAllBytes("input.pdf")), "file", "input.pdf" },
};

var response = await client.PostAsync(
    "https://api.pdfblocks.com/v1/remove_signatures", form);
response.EnsureSuccessStatusCode();
await File.WriteAllBytesAsync(
    "unsigned.pdf", await response.Content.ReadAsByteArrayAsync());

Response

On success, the response is 200 OK with the PDF as the body:

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 48213

The output is the same document with every signature and timestamp removed: its pages and content are unchanged. Stream the body straight to a file, as the examples above do; nothing is stored on our side.

Errors

Failed requests return an application/problem+json body. The most common one for this endpoint is a 400, returned when file isn’t a readable PDF. The errors object names each field:

{
  "type": "https://www.pdfblocks.com/docs/api/v1/error/400",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "file": ["Could not parse the PDF document. The file may be invalid or corrupt."]
  }
}

A missing or invalid X-API-Key returns a 401. See Errors for every status code and the full response shape.