Sign PDF

Add digital signatures to PDF documents.

POSThttps://api.morphopdf.com/v1/pdf/sign

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the PDF file and signature information.

fileFile

PDF file uploaded via multipart/form-data.

urlstringOptional

Public URL pointing to a PDF file. Alternative to file upload.

signatureobject

Signature configuration object (see below).

Signature Object

Configure the signature appearance and placement.

signerNamestring

Name of the person signing the document.

signatureDatastring

Base64-encoded PNG or JPEG image of the signature.

signaturesarray

Array of signature positions. Each position specifies where to place the signature.

Signature Position

Each item in the signatures array specifies a signature placement.

pagenumber

Page number (1-indexed) where the signature should be placed.

xnumber

X coordinate (in points) from the left edge of the page.

ynumber

Y coordinate (in points) from the top edge of the page.

widthnumber

Width of the signature image in points.

heightnumber

Height of the signature image in points.

Query Parameters

formatstringOptionalDefault: json

Response format. Use 'binary' to receive the signed PDF directly, or 'json' (default) to receive metadata with a download URL.

Coordinate System

Coordinates use a top-left origin with measurements in PDF points (1 point = 1/72 inch). A standard US Letter page is 612 x 792 points, and A4 is 595 x 842 points.

Response

When using format=json (default):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

fileNamestring

Name of the signed PDF document.

downloadUrlstring

Presigned URL to download the file. Valid for 1 hour.

signaturesAppliednumber

Number of signature placements applied to the document.

signerstring

Name of the signer.

Binary Response

Add ?format=binary to receive the signed PDF directly with these headers:

  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="signed.pdf"

Error Responses

StatusCodeDescription
400INVALID_INPUTNo file provided or invalid file format
400MISSING_REQUIRED_FIELDMissing signerName, signatureData, or signature positions
400PASSWORD_PROTECTEDCannot sign password-protected PDF. Unlock it first.
401AUTHENTICATION_REQUIREDMissing or invalid API key
413FILE_TOO_LARGEFile exceeds maximum size limit
500PROCESSING_FAILEDInternal processing error
POST/v1/pdf/sign
curl -X POST "https://api.morphopdf.com/v1/pdf/sign?format=binary" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F 'signature={"signerName":"John Doe","signatureData":"<base64-encoded-image>","signatures":[{"page":1,"x":100,"y":100,"width":200,"height":50}]}' \
  --output signed.pdf
200OK
{
  "success": true,
  "message": "File processed successfully",
  "fileName": "signed.pdf",
  "downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/signed.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
  "signaturesApplied": 2,
  "signer": "John Doe"
}