Signature positioning
Use Placeholders to Position Signatures
Position a signature place with a [[place_key]] text placeholder in your PDF or DOCX, so the place follows the text when the layout changes.
In SignatureAPI, places are areas in a document where recipients sign, enter information, or where details, such as dates, are automatically added. The signature place is one of them. Where a place appears is set by positioning.
There are two ways to position places: fixed positions (coordinates) and placeholders within the document. In this example, we will show how to position a signature place using a placeholder.
For this example, we will create an envelope with:
- One recipient (of type
signer), identified with the keyvisitor. - The visitor signs a single PDF document.
- The document will have one signature place, identified with the key
signer_signs_here, that will be signed by the recipientvisitor.
All other envelope settings use the default configuration:
- The recipient will receive an email with a link to sign.
- The account’s default language, timezone, and timestamp format used.
Prepare your Document
Placeholders are text within your PDF document that define the location where places (such as signatures, initials, text inputs, etc.) should appear. They follow the format [[place_key]], where place_key identifies the place within the document.
Place placeholders use double brackets: [[place_key]]. Template fields use double curly braces ({{field_key}}) to inject content into DOCX documents. A DOCX document can use both. See Document Templates for template fields.
For this example, we prepared a document that contains the placeholder [[signer_signs_here]] to indicate the position of the place with the key signer_signs_here.
Two rules apply to every placeholder:
- It must be text in the document, text you can select and copy, not part of an image or a scanned page. SignatureAPI finds placeholders by reading the document’s text.
- Placeholders and places must match one to one. A place whose placeholder isn’t in the document makes the request fail with
invalid-places. A placeholder with no matching place fails withinvalid-placeholder. Both errors are422responses to the create request, so no envelope is created. A placeholder that appears twice in the document fails withduplicate-placeholder.
Example document
Download the PDF used in this example.
Create the Envelope
When creating the envelope, add the signature place object to the places array inside the document object, with the following properties:
key: This identifies the place within the document. Must match what’s inside the square brackets in the placeholder inside the document file, in this case:signer_signs_here.type: As this is a signature place, we use the valuesignature.recipient_key: The key of the recipient that will sign in this place. In this example, there is just one recipient, who has the keyvisitor.
POST /v1/envelopes HTTP/1.1
Host: api.signatureapi.com
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"title": "Privacy Consent",
"message": "Please review and sign the privacy consent.",
"documents": [
{
"url": "https://pub-9cb75390636c4a8a83a6f76da33d7f45.r2.dev/privacy-placeholder.pdf",
"format": "pdf",
"places": [
{
"key": "signer_signs_here",
"type": "signature",
"recipient_key": "visitor"
}
]
}
],
"recipients": [
{
"type": "signer",
"key": "visitor",
"name": "Jane Doe",
"email": "jane.doe@example.com"
}
]
}Result
If the request is successful, SignatureAPI sends Jane Doe (the recipient) an email with a link to sign. Jane opens the link, and the signature place sits on top of the placeholder:
Hide the placeholder
The signature covers the placeholder, but a colored placeholder can still show around it. Set the placeholder text to white so only the signature remains. This example from another document shows the three stages:
1. Placeholders in the document
2. Signed, with visible placeholders
3. Signed, with white placeholders
Try It
Try this example in Postman (“Create an envelope with placeholders”) using your test API key to create a free, non-binding test envelope. Test envelopes don’t send emails, but you can review them in the Dashboard.
Keep Learning
- Learn how to position a signature using coordinates when exact positioning is required.
- Explore other types of places, such as initials, text inputs, or completion dates.