Compare Payload
Outliny's Compare Payload feature helps you detect differences between two versions of input data used for rendering templates (Emails or PDFs).
This is useful for:
- Verifying if dynamic content has changed before regenerating documents.
- Auditing changes over time (e.g., invoice updates, contract version tracking).
- Avoiding redundant API calls if the payload is identical.
What is a Compare Payload?
A Compare Payload request checks if two sets of template parameters would generate different outputs — without fully rendering the Email or PDF. Instead of producing a document, it compares the incoming variables against a previous version and tells you if there’s any difference.
Endpoint
POST /api/v1/compare/payloadAuthentication
Just like all other API calls, you must include your API Key:
Authorization: Bearer YOUR_API_KEYRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| template_id | string | Yes | The ID of the template you're comparing against. |
| old_parameters | object | Yes | The original parameters used previously. |
| new_parameters | string | object | The new parameters you want to compare. |
Example Request
POST https://api.outliny.com/api/v1/compare/payload
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"template_id": "template_abc123",
"old_parameters": {
"customer_name": "Alice Johnson",
"invoice_total": "$500"
},
"new_parameters": {
"customer_name": "Alice Johnson",
"invoice_total": "$500"
}
}Response
Fields returned:
status(string): "success"is_different(boolean): true if payloads differ, false if identicaldifferences(object): fields that changed, if any
Example Response (Identical)
{
"status": "success",
"is_different": false,
"differences": {}
}Example Response (Differences Found)
{
"status": "success",
"is_different": true,
"differences": {
"invoice_total": {
"old": "$500",
"new": "$550"
}
}
}When to Use Compare Payload
- Efficiency: Only regenerate PDFs or Emails when data has actually changed.
- Auditing: Track small but critical updates in contracts, invoices, HR letters, etc.
- Versioning: Decide when to store or archive updated document versions.
- Optimization: Save API credits and system processing by skipping unnecessary rendering.
Important Notes
- Compare Payload only compares input parameters, not full rendered outputs.
- Deep object comparison is supported (nested data structures too).
- Only available for templates that use Jinja variables for dynamic content.
- Fields not used in the template are ignored automatically for comparison.