Populate Images via API in Contracts
This help article explains how to automatically add images to your contracts during document creation through API integration, eliminating the need to manually insert images afterward.
What is API Image Population?
API image population allows you to automatically insert images into your contracts during document creation through API calls. Instead of manually opening documents to add images afterward, the images are populated directly from your systems or databases when the document is created.
This feature is particularly valuable for teams that frequently include product images, branded visuals, or other dynamic content in their sales documents.
Who Can Use This Feature?
This feature is available on Sales Trial, Professional, and Enterprise plans. You'll need:
An active API integration or connection to GetAccept
Basic technical knowledge to set up API calls
Access to image sources (databases, systems, or file uploads)
Note: Web trials do not have access to the API. Deal Rooms and integrations are not included in this feature.
How It Works
API image population uses merge tags and the GetAccept API to dynamically insert images:
Create contract templates with image placeholders using merge tags
Upload images using the GetAccept Upload API
Set up API calls that include your uploaded image data
Generate contracts with images automatically populated
Send documents without manual image insertion
Setting Up Image Placeholders in Templates
When building your contract templates:
Insert an image element where you want dynamic content
Use merge tag format for the image source:
{{image_key}}
Replace
image_key
with your chosen identifier (e.g.,{{product_image}}
,{{company_logo}}
)Save your template
You can create templates with either empty images or images already populated using merge tags.
Example Template Setup
Product Proposal for {{client_name}} Featured Product: {{product_name}} [Image placeholder with merge tag: {{product_image}}] Price: {{product_price}}
API Implementation
Step 1: Upload Your Images
Before creating documents, upload your images using the Upload API:
Endpoint: POST https://api.getaccept.com/v1/upload
You can upload images using:
Multipart POST requests
Various supported file types (see Upload files API documentation for complete list)
Step 2: Get Custom Images from Templates
To see what image merge tags are available in your template:
Endpoint: GET https://api.getaccept.com/v1/templates/{TEMPLATE_ID}/custom-images
This returns the merge tags configured in your template that you can populate with images.
Step 3: Create Documents with Image Data
When making API calls to create documents, include your image data in the custom_images
array:
json{ "template_id": "your_template_id", "merge_data": { "client_name": "Acme Corp", "product_name": "Premium Widget", "product_price": "$299" }, "custom_images": [ { "id": "V1StGXR8_Z5jdHi6B-myT", "file_id": "abc456.png" }, { "name": "My custom image", "file_id": "abc4578.png" } ] }
Best Practices
Image Requirements
Use high-quality images (minimum 300 DPI for print documents)
Optimize file sizes for faster loading
Use consistent aspect ratios for professional appearance
Check supported file types in the Upload files API documentation
Template Design
Plan image placement during template creation
Use descriptive merge tag names (e.g.,
{{hero_image}}
,{{product_photo}}
)Test templates with sample data before production use
Consider responsive design for different document formats
API Integration
Upload images first using the Upload API before referencing them
Use the Get custom images endpoint to verify available merge tags
Implement error handling for missing or invalid images
Keep merge tag names consistent across templates
Limitations and Considerations
Current Limitations
Does not support Edit-after-send functionality
Cannot edit the key name of an image within a document after creation
Requires technical setup for API connections
Images must be uploaded through the GetAccept Upload API
Technical Requirements
Understanding of API calls and JSON formatting
Access to the GetAccept Upload API
Ability to handle multipart POST requests for image uploads
Troubleshooting
Images Not Appearing
Verify merge tag names match exactly between template and API call
Check that images were successfully uploaded using the Upload API
Ensure
file_id
values in your request match uploaded filesConfirm API request format matches documentation
Image Quality Issues
Use appropriate resolution for document type
Check supported file formats in Upload files API documentation
Test different image formats for best results
API Connection Problems
Verify API credentials and permissions
Check request format against API documentation
Test image uploads separately before document creation
Confirm you're using Sales Trial, Professional, or Enterprise plan
Getting Started
Plan your image strategy: Identify which contracts need dynamic images
Prepare your images: Gather images you want to use dynamically
Upload your images: Use the Upload API to get file IDs
Update your templates: Add merge tags for image placeholders
Test your API calls: Start with simple examples using the custom_images format
Implement in production: Roll out to your team with proper training