Skip to main content

Sign PDF

POST https://api.getdocuforge.dev/v1/pdf/sign Add a visual digital signature annotation to a PDF document.

Request Body

ParameterTypeRequiredDescription
pdfstringYesBase64-encoded PDF document
namestringYesSigner name
reasonstringNoReason for signing
locationstringNoLocation of signing
contactstringNoSigner contact information
pageintegerNoPage number for the signature (0-indexed)
xnumberNoX coordinate for signature placement
ynumberNoY coordinate for signature placement
widthnumberNoWidth of the signature box
heightnumberNoHeight of the signature box
outputstringNo"url" (default) or "base64"

Example

curl -X POST https://api.getdocuforge.dev/v1/pdf/sign \
  -H "Authorization: Bearer df_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "pdf": "<base64-encoded-pdf>",
    "name": "Jane Doe",
    "reason": "Contract approval",
    "location": "San Francisco, CA",
    "page": 0,
    "x": 350,
    "y": 50,
    "width": 200,
    "height": 60
  }'

Response (URL mode)

{
  "url": "https://cdn.getdocuforge.dev/gen_abc123.pdf",
  "file_size": 48200,
  "signed": true
}

Response (base64 mode)

{
  "data": "<base64-encoded-signed-pdf>",
  "file_size": 48200,
  "signed": true
}

Errors

StatusCodeDescription
400VALIDATION_ERRORMissing signer name or PDF exceeds size limit
401UNAUTHORIZEDInvalid or missing API key
429RATE_LIMITEDToo many requests
500INTERNAL_ERRORServer error during signing