Retrieve a paginated list of versions for a specific asset.
GET
/
assets
/
{id}
/
versions
curl--request GET \--url https://api.posta.co/assets/{id}/versions \--header'X-Api-Key: <api-key>'
{"items":[{"id":"astv_2jyk1xYhW4n0vVfHirU5eJeXsbw","status":"draft","notes":"Minor changes to the footer.","content":{"source":"inline","type":"text/html","content":"<html><body>Hello {{firstName}}</body></html>"},"variableDefinitions":[{"name":"name","behavior":"required","allowEmpty":false}],"contentType":"text/html","contentLength":100,"contentUrl":"https://api.posta.co/assets/astv_2jyk1xYhW4n0vVfHirU5eJeXsbw/content","publish":false,"createdAt":"2023-06-07T12:34:56Z","modifiedAt":"2023-06-07T12:34:56Z"}],"nextToken":"<string>"}
Represents a specific version of an Asset, containing the actual content and metadata. Asset Versions are the core entities for version control, compliance tracking, and content management in Posta.
Key aspects:
Content: Can be HTML templates (with variable support), images, fonts, or documents (e.g., PDFs).
Status: Determines the overall status of the parent Asset (draft, published, archived, or deleted).
Version Control: Allows tracking changes and maintaining multiple iterations of an Asset.
Compliance: Facilitates auditing and regulatory compliance through versioning.
HTML templates can use variables for dynamic content. Images and fonts can be referenced as variables within HTML templates. Documents (like PDFs) are static and used for rendering documents without dynamic components.
List of variables defined for this Asset Version. Used for content personalization in HTML templates.
Note: When using Assets with Variables with our Letter API, always review the variableHandling option on the Letter. If validationScope is set to none in the request, the defined variables and their behavior will not be evaluated at all. See further information on the Letter object.
List of variables defined for this Asset Version. Used for content personalization in HTML templates.
A maximum of 128 variable definitions can be specified per Asset Version.
This limit helps maintain performance and readability of templates.
value: A string value (default Variable type when not specified)
asset: References another Asset by its Id
externalUrl: References content at an external URL (must be publicly available)
Note: We recommend using asset type Variables instead of externalUrl for better consistency,
security, compliance, and availability. External URLs might change without version control,
may be subject to throttling, or could become unavailable.
Specifies how the Variable should be handled during rendering.
optional: The Variable is optional and may or may not be provided in a request (such as create letter). If allowEmpty is true you can pass an empty string as its value.
required: The Variable must be provided in a request (such as create letter). If allowEmpty is true you can pass an empty string as its value.
preset: The preset value will be used and the variable should not be included in the request (such as create letter). The presetValue must be defined when this behavior is used. allowEmpty is not applicable to this behavior.
overridablePreset: The preset value will be used, unless a value is explicitly passed in a request to override the preset value. The presetValue must be set when this behavior is used, and the variable can be included in a request if an override is necessary, otherwise the presetValue will be used. If allowEmpty is true you can pass an empty string as its value.
Note: When using Assets with Variables with our Letter API, always review the variableHandling option on the Letter. If validationScope is set to none in the request, the defined variables and their behavior will not be evaluated at all. See further information on the Letter object.
For detailed examples and edge cases on how behavior, allowEmpty, and presetValue
interact, see the Assets Overview in our API reference.
Provides a sample value for the Variable, useful for documentation and UI purposes.
This value is not used in the actual rendering process. It's primarily for demonstrating
expected input in user interfaces or documentation.
curl--request GET \--url https://api.posta.co/assets/{id}/versions \--header'X-Api-Key: <api-key>'
{"items":[{"id":"astv_2jyk1xYhW4n0vVfHirU5eJeXsbw","status":"draft","notes":"Minor changes to the footer.","content":{"source":"inline","type":"text/html","content":"<html><body>Hello {{firstName}}</body></html>"},"variableDefinitions":[{"name":"name","behavior":"required","allowEmpty":false}],"contentType":"text/html","contentLength":100,"contentUrl":"https://api.posta.co/assets/astv_2jyk1xYhW4n0vVfHirU5eJeXsbw/content","publish":false,"createdAt":"2023-06-07T12:34:56Z","modifiedAt":"2023-06-07T12:34:56Z"}],"nextToken":"<string>"}