curl --request POST \
--url https://api.posta.co/assets/{id}/versions/{versionId}/clone \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"notes": "Initial version.",
"publish": false
}
'{
"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"
}Clone an Asset Version.
curl --request POST \
--url https://api.posta.co/assets/{id}/versions/{versionId}/clone \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"notes": "Initial version.",
"publish": false
}
'{
"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"
}Unique idempotency key for each request (e.g., V4 UUID).
The unique identifier of the asset. Format: 'ast_' followed by alphanumeric characters.
The unique identifier of the asset version. Format: 'astv_' followed by alphanumeric string.
TODO
Optional notes or comments about this specific Asset Version. Useful for tracking changes or providing context.
255"Initial version."
If set to true, this Asset Version will be published immediately after creation. Default is false.
false
Generic response for a resource request
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:
draft, published, archived, or deleted).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.
Unique identifier for the Asset Version. Format: 'astv_' followed by alphanumeric characters.
1 - 99999"astv_2jyk1xYhW4n0vVfHirU5eJeXsbw"
Represents the status of an Asset Version.
draft: An Asset Version that is being worked on and can be modified. This is the initial state for new Asset Version and cloned Asset Versions.
published: An Asset Version that is finalized and available for use. Published Asset Versions cannot be edited.
archived: An Asset Version unavailable for new uses but may still be accessible for historical purposes. It can be republished if needed.
deleted: An Asset Version that has been deleted from the system. This is a terminal state.
State transitions:
Notes:
draft, published, archived, deleted "draft"
MIME type of the Asset Version content. Indicates the format of the content (e.g., 'text/html', 'image/jpeg', 'application/pdf').
1 - 99999"text/html"
Length of the Asset Version content in bytes. Useful for content management and transfer considerations.
-1 <= x <= 999999999100
URL where the rendered content of this asset version can be accessed. Available after publishing.
1 - 99999"https://api.posta.co/assets/astv_2jyk1xYhW4n0vVfHirU5eJeXsbw/content"
The timestamp the resource was created at (UTC).
The timestamp the resource was last modified at (UTC).
Optional notes or comments about this specific Asset Version. Useful for tracking changes or providing context.
255"Initial version."
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.
128Show child attributes